From: Sebastian Hesselbarth Date: Fri, 13 Dec 2013 09:20:28 +0000 (+0100) Subject: net: phy: resume/suspend PHYs on attach/detach X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1211ce53077164e0d34641d0ca5fb4d4a7574498;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git net: phy: resume/suspend PHYs on attach/detach This ensures PHYs are resumed on attach and suspended on detach. Signed-off-by: Sebastian Hesselbarth Acked-by: Mugunthan V N Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller --- diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 91f17178f1b3..4eb5bba1db5e 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -624,6 +624,8 @@ static int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, if (err) phy_detach(phydev); + phy_resume(phydev); + return err; } @@ -669,6 +671,7 @@ void phy_detach(struct phy_device *phydev) { phydev->attached_dev->phydev = NULL; phydev->attached_dev = NULL; + phy_suspend(phydev); /* If the device had no specific driver before (i.e. - it * was using the generic driver), we unbind the device