Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1211ce53 authored by Sebastian Hesselbarth's avatar Sebastian Hesselbarth Committed by David S. Miller
Browse files

net: phy: resume/suspend PHYs on attach/detach



This ensures PHYs are resumed on attach and suspended on detach.

Signed-off-by: default avatarSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: default avatarMugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 481b5d93
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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