Skip to content

Commit

Permalink
net: phy: resume/suspend PHYs on attach/detach
Browse files Browse the repository at this point in the history
This ensures PHYs are resumed on attach and suspended on detach.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sebastian Hesselbarth authored and David S. Miller committed Dec 17, 2013
1 parent 481b5d9 commit 1211ce5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/phy/phy_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1211ce5

Please sign in to comment.