Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: stmmac: avoid passing pci_dev

The pci_dev is only used to provide the ethtool bus_info using
pci_name(priv->plat->pdev). This is the same as dev_name(priv->device).
Thus, rather than passing the pci_dev, make use of what we already
have.

To avoid unexpectedly exposing the device name through ethtool where
it wasn't provided before, add a flag priv->plat->provide_bus_info
to enable this, which only dwmac-intel needs to set.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/E1w0evI-0000000CzY7-1fyo@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Russell King (Oracle) and committed by
Jakub Kicinski
f807b5b9 f4ce4922

+4 -5
+1 -1
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
··· 589 589 int ret; 590 590 int i; 591 591 592 - plat->pdev = pdev; 592 + plat->provide_bus_info = true; 593 593 plat->phy_addr = -1; 594 594 plat->clk_csr = STMMAC_CSR_250_300M; 595 595 plat->core_type = DWMAC_CORE_GMAC4;
+2 -3
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
··· 312 312 strscpy(info->driver, MAC100_ETHTOOL_NAME, 313 313 sizeof(info->driver)); 314 314 315 - if (priv->plat->pdev) { 316 - strscpy(info->bus_info, pci_name(priv->plat->pdev), 315 + if (priv->plat->provide_bus_info) 316 + strscpy(info->bus_info, dev_name(priv->device), 317 317 sizeof(info->bus_info)); 318 - } 319 318 } 320 319 321 320 static int stmmac_ethtool_get_link_ksettings(struct net_device *dev,
+1 -1
include/linux/stmmac.h
··· 348 348 int rss_en; 349 349 int mac_port_sel_speed; 350 350 u8 vlan_fail_q; 351 - struct pci_dev *pdev; 351 + bool provide_bus_info; 352 352 int int_snapshot_num; 353 353 int msi_mac_vec; 354 354 int msi_wol_vec;