diff options
author | Andrew Lunn <andrew@lunn.ch> | 2016-01-06 20:11:13 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-01-07 14:31:25 -0500 |
commit | 2220943a21e26d97d7fd8f83c004b947326b469d (patch) | |
tree | 946d1428fce5312b0537137411784c8b0c41c222 /drivers/net/ethernet/smsc | |
parent | 053e7e169229adebbc27fc176c5369398e9f5eba (diff) | |
download | linux-2220943a21e26d97d7fd8f83c004b947326b469d.tar.gz linux-2220943a21e26d97d7fd8f83c004b947326b469d.tar.bz2 linux-2220943a21e26d97d7fd8f83c004b947326b469d.zip |
phy: Centralise print about attached phy
Many Ethernet drivers contain the same netdev_info() print statement
about the attached phy. Move it into the phy device code. Additionally
add a varargs function which can be used to append additional
information.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/smsc')
-rw-r--r-- | drivers/net/ethernet/smsc/smsc911x.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/smsc/smsc9420.c | 9 |
2 files changed, 3 insertions, 10 deletions
diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c index 067346d3209d..139b99b04099 100644 --- a/drivers/net/ethernet/smsc/smsc911x.c +++ b/drivers/net/ethernet/smsc/smsc911x.c @@ -1031,9 +1031,7 @@ static int smsc911x_mii_probe(struct net_device *dev) return ret; } - netdev_info(dev, - "attached PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n", - phydev->drv->name, phydev_name(phydev), phydev->irq); + phy_attached_info(phydev); /* mask with MAC supported features */ phydev->supported &= (PHY_BASIC_FEATURES | SUPPORTED_Pause | diff --git a/drivers/net/ethernet/smsc/smsc9420.c b/drivers/net/ethernet/smsc/smsc9420.c index a02ed6b63064..fa8893a804f7 100644 --- a/drivers/net/ethernet/smsc/smsc9420.c +++ b/drivers/net/ethernet/smsc/smsc9420.c @@ -1163,10 +1163,6 @@ static int smsc9420_mii_probe(struct net_device *dev) return -ENODEV; } - phydev = pd->mii_bus->phy_map[1]; - netif_info(pd, probe, pd->dev, "PHY addr %d, phy_id 0x%08X\n", - phydev->addr, phydev->phy_id); - phydev = phy_connect(dev, phydev_name(phydev), smsc9420_phy_adjust_link, PHY_INTERFACE_MODE_MII); @@ -1175,14 +1171,13 @@ static int smsc9420_mii_probe(struct net_device *dev) return PTR_ERR(phydev); } - netdev_info(dev, "attached PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n", - phydev->drv->name, phydev_name(phydev), phydev->irq); - /* mask with MAC supported features */ phydev->supported &= (PHY_BASIC_FEATURES | SUPPORTED_Pause | SUPPORTED_Asym_Pause); phydev->advertising = phydev->supported; + phy_attached_info(phydev); + pd->phy_dev = phydev; pd->last_duplex = -1; pd->last_carrier = -1; |