We don't have to do all the checks again which we did in mdio_bus_phy_suspend already. Instead we can simply check whether the PHY is actually suspended and needs to be resumed.
Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com> --- v2: - no changes --- drivers/net/phy/phy_device.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 9e4ba8e80..1662781fb 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -132,14 +132,12 @@ static int mdio_bus_phy_resume(struct device *dev) struct phy_device *phydev = to_phy_device(dev); int ret; - if (!mdio_bus_phy_may_suspend(phydev)) - goto no_resume; - - ret = phy_resume(phydev); - if (ret < 0) - return ret; + if (phydev->suspended) { + ret = phy_resume(phydev); + if (ret < 0) + return ret; + } -no_resume: if (phydev->attached_dev && phydev->adjust_link) phy_start_machine(phydev); -- 2.17.0