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

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
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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))