Skip to content

Commit

Permalink
net: phy: Log only PHY state transitions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marc Gonzalez authored and David S. Miller committed Jul 31, 2017
1 parent 6e72917 commit 6a95bef
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/net/phy/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6a95bef

Please sign in to comment.