net: phy: resume/suspend PHYs on attach/detach
authorSebastian Hesselbarth <[email protected]>
Fri, 13 Dec 2013 09:20:28 +0000 (10:20 +0100)
committerDavid S. Miller <[email protected]>
Tue, 17 Dec 2013 19:42:44 +0000 (14:42 -0500)
This ensures PHYs are resumed on attach and suspended on detach.

Signed-off-by: Sebastian Hesselbarth <[email protected]>
Acked-by: Mugunthan V N <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
drivers/net/phy/phy_device.c

index 91f17178f1b32ff8a5fdad0eea972caabe9f89f5..4eb5bba1db5e012f096c4753678267f639cb2495 100644 (file)
@@ -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