diff options
author | Florian Fainelli | 2014-02-11 17:27:33 -0800 |
---|---|---|
committer | David S. Miller | 2014-02-12 19:08:19 -0500 |
commit | 43b6329f982092d8fe5c953940609ca8ee3055df (patch) | |
tree | bd08cd23e60c247b74a56789ad79ce3a723af50a /drivers/net/phy | |
parent | 0e4767aaf499c98cf8a0120ee150e3aa38cee44f (diff) |
net: phy: use network device in phy_print_status
phy_print_status() currently uses dev_name(&phydev->dev) which will
usually result in printing something along those lines for Device Tree
aware drivers:
libphy: f0b60000.etherne:0a - Link is Down
libphy: f0ba0000.etherne:00 - Link is Up - 1000/Full
This is not terribly useful for network administrators or users since we
expect a network interface name to be able to correlate link events with
interfaces. Update phy_print_status() to use netdev_info() with
phydev->attached_dev which is the backing network device for our PHY
device. The leading dash is removed since netdev_info() prefixes the
messages with "<interface>: " already.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/phy.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 19c9eca0ef26..c35b2e73168a 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -45,12 +45,11 @@ void phy_print_status(struct phy_device *phydev) { if (phydev->link) { - pr_info("%s - Link is Up - %d/%s\n", - dev_name(&phydev->dev), + netdev_info(phydev->attached_dev, "Link is Up - %d/%s\n", phydev->speed, DUPLEX_FULL == phydev->duplex ? "Full" : "Half"); } else { - pr_info("%s - Link is Down\n", dev_name(&phydev->dev)); + netdev_info(phydev->attached_dev, "Link is Down\n"); } } EXPORT_SYMBOL(phy_print_status); |