From: Florian Fainelli <f.fainelli@gmail.com>
To: <netdev@vger.kernel.org>
Cc: <davem@davemloft.net>, Florian Fainelli <f.fainelli@gmail.com>
Subject: [PATCH 01/10] net: phy: use network device in phy_print_status
Date: Tue, 11 Feb 2014 17:27:33 -0800 [thread overview]
Message-ID: <1392168462-18888-2-git-send-email-f.fainelli@gmail.com> (raw)
In-Reply-To: <1392168462-18888-1-git-send-email-f.fainelli@gmail.com>
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>
---
drivers/net/phy/phy.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 19c9eca..c35b2e7 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);
--
1.8.3.2
next prev parent reply other threads:[~2014-02-12 1:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-12 1:27 [PATCH 00/10] net: phy: small cleanups and improvements Florian Fainelli
2014-02-12 1:27 ` Florian Fainelli [this message]
2014-02-13 0:13 ` [PATCH 01/10] net: phy: use network device in phy_print_status David Miller
2014-02-13 0:20 ` Florian Fainelli
2014-02-13 0:22 ` David Miller
2014-02-12 1:27 ` [PATCH 02/10] net: phy: update phy_print_status to show pause settings Florian Fainelli
2014-02-12 1:27 ` [PATCH 03/10] net: phy: display human readable PHY speed settings Florian Fainelli
2014-02-12 1:27 ` [PATCH 04/10] net: phy: add genphy_aneg_done() Florian Fainelli
2014-02-12 14:43 ` Sergei Shtylyov
2014-02-12 1:27 ` [PATCH 05/10] net: phy: allow driver to implement their own aneg_done Florian Fainelli
2014-02-12 1:27 ` [PATCH 06/10] net: phy: fix phy_{clear,config}_interrupt comment typos Florian Fainelli
2014-02-12 1:27 ` [PATCH 07/10] net: phy: re-design phy_modes to be self-contained Florian Fainelli
2014-02-12 1:27 ` [PATCH 08/10] net: phy: expose PHY device interface mode Florian Fainelli
2014-02-12 1:27 ` [PATCH 09/10] net: phy: add "has_fixups" boolean property Florian Fainelli
2014-02-12 1:27 ` [PATCH 10/10] net: phy: expose phydev->has_fixups to sysfs Florian Fainelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1392168462-18888-2-git-send-email-f.fainelli@gmail.com \
--to=f.fainelli@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).