Skip to content

Commit 5116a8a

Browse files
ffainellidavem330
authored andcommitted
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: 2b3e88e ("net: phy: improve phy state checking") Signed-off-by: Florian Fainelli <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c2b727d commit 5116a8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/phy/phy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ void phy_stop(struct phy_device *phydev)
996996
{
997997
struct net_device *dev = phydev->attached_dev;
998998

999-
if (!phy_is_started(phydev)) {
999+
if (!phy_is_started(phydev) && phydev->state != PHY_DOWN) {
10001000
WARN(1, "called from state %s\n",
10011001
phy_state_to_str(phydev->state));
10021002
return;

0 commit comments

Comments
 (0)