Skip to content

Commit

Permalink
net: phy: utilize phy_suspend and phy_resume
Browse files Browse the repository at this point in the history
phy_suspend and phy_resume are an abstraction on top of the PHY device
driver suspend and resume callbacks, utilize those since they are the
proper interface to suspending and resuming a PHY device.

Acked-by: Fugang Duan <[email protected]>
Tested-by: Fugang Duan <[email protected]>
Signed-off-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
ffainelli authored and davem330 committed Jan 27, 2015
1 parent d2fa7cc commit 9272efa
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/phy/mdio_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,6 @@ static bool mdio_bus_phy_may_suspend(struct phy_device *phydev)

static int mdio_bus_suspend(struct device *dev)
{
struct phy_driver *phydrv = to_phy_driver(dev->driver);
struct phy_device *phydev = to_phy_device(dev);

/* We must stop the state machine manually, otherwise it stops out of
Expand All @@ -479,19 +478,18 @@ static int mdio_bus_suspend(struct device *dev)
if (!mdio_bus_phy_may_suspend(phydev))
return 0;

return phydrv->suspend(phydev);
return phy_suspend(phydev);
}

static int mdio_bus_resume(struct device *dev)
{
struct phy_driver *phydrv = to_phy_driver(dev->driver);
struct phy_device *phydev = to_phy_device(dev);
int ret;

if (!mdio_bus_phy_may_suspend(phydev))
goto no_resume;

ret = phydrv->resume(phydev);
ret = phy_resume(phydev);
if (ret < 0)
return ret;

Expand Down

0 comments on commit 9272efa

Please sign in to comment.