Commit 5116a8ad authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

net: phy: Do not warn in phy_stop() on PHY_DOWN

When phy_is_started() was added to catch incorrect PHY states,
phy_stop() would not be qualified against PHY_DOWN. It is possible to
reach that state when the PHY driver has been unbound and the network
device is then brought down.

Fixes: 2b3e88ea ("net: phy: improve phy state checking")
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c2b727df
...@@ -996,7 +996,7 @@ void phy_stop(struct phy_device *phydev) ...@@ -996,7 +996,7 @@ void phy_stop(struct phy_device *phydev)
{ {
struct net_device *dev = phydev->attached_dev; struct net_device *dev = phydev->attached_dev;
if (!phy_is_started(phydev)) { if (!phy_is_started(phydev) && phydev->state != PHY_DOWN) {
WARN(1, "called from state %s\n", WARN(1, "called from state %s\n",
phy_state_to_str(phydev->state)); phy_state_to_str(phydev->state));
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment