From: Heiner Kallweit Date: Thu, 23 Apr 2020 19:34:33 +0000 (+0200) Subject: net: phy: make phy_suspend a no-op if PHY is suspended already X-Git-Tag: v5.8-rc1~165^2~437^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d70c47c8dc6902db19555b7ff7e6eeb264d4ac06;p=thirdparty%2Fkernel%2Flinux.git 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: Heiner Kallweit Signed-off-by: David S. Miller --- diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index ac2784192472f..206d98502b13c 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -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))