Commit d70c47c8 authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller

net: phy: make phy_suspend a no-op if PHY is suspended already

Gently handle the case that phy_suspend() is called whilst PHY is in
power-down.
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5c05c1db
......@@ -1524,6 +1524,9 @@ int phy_suspend(struct phy_device *phydev)
struct phy_driver *phydrv = phydev->drv;
int ret;
if (phydev->suspended)
return 0;
/* If the device has WOL enabled, we cannot suspend the PHY */
phy_ethtool_get_wol(phydev, &wol);
if (wol.wolopts || (netdev && netdev->wol_enabled))
......
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