aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/phy.c
diff options
context:
space:
mode:
authorMarc Gonzalez <marc_gonzalez@sigmadesigns.com>2017-07-28 13:18:30 +0200
committerDavid S. Miller <davem@davemloft.net>2017-07-31 16:21:31 -0700
commit6a95befc8d0346d6cb3b4646c761e8b42e66a4df (patch)
treef1cd4591138e102447549aa2d9d54877926b8ed1 /drivers/net/phy/phy.c
parentMerge branch 'mlxsw-Various-small-fixes' (diff)
downloadlinux-dev-6a95befc8d0346d6cb3b4646c761e8b42e66a4df.tar.xz
linux-dev-6a95befc8d0346d6cb3b4646c761e8b42e66a4df.zip
net: phy: Log only PHY state transitions
In the current code, old and new PHY states are always logged. >From now on, log only PHY state transitions. Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/phy/phy.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index ac1dcf0289fa..3aedf415908b 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -1225,9 +1225,10 @@ void phy_state_machine(struct work_struct *work)
if (err < 0)
phy_error(phydev);
- phydev_dbg(phydev, "PHY state change %s -> %s\n",
- phy_state_to_str(old_state),
- phy_state_to_str(phydev->state));
+ if (old_state != phydev->state)
+ phydev_dbg(phydev, "PHY state change %s -> %s\n",
+ phy_state_to_str(old_state),
+ phy_state_to_str(phydev->state));
/* Only re-schedule a PHY state machine change if we are polling the
* PHY, if PHY_IGNORE_INTERRUPT is set, then we will be moving