mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-23 22:34:21 +08:00
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 <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
5c05c1dbb1
commit
d70c47c8dc
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user