diff options
| author | Florian Fainelli <f.fainelli@gmail.com> | 2015-01-27 01:05:37 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2015-01-27 03:16:51 -0500 |
| commit | 9272efa2036f3f06625effc3a709416044578a92 (patch) | |
| tree | f069aad2559f3e77c3fd1779b4578e1058ff799a /drivers/net/phy | |
| parent | d2fa7cc4e3bd759f5c8e093d1e08b718c722f319 (diff) | |
net: phy: utilize phy_suspend and phy_resume
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 <B38611@freescale.com>
Tested-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
| -rw-r--r-- | drivers/net/phy/mdio_bus.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 50051f271b10..20447741893a 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c | |||
| @@ -465,7 +465,6 @@ static bool mdio_bus_phy_may_suspend(struct phy_device *phydev) | |||
| 465 | 465 | ||
| 466 | static int mdio_bus_suspend(struct device *dev) | 466 | static int mdio_bus_suspend(struct device *dev) |
| 467 | { | 467 | { |
| 468 | struct phy_driver *phydrv = to_phy_driver(dev->driver); | ||
| 469 | struct phy_device *phydev = to_phy_device(dev); | 468 | struct phy_device *phydev = to_phy_device(dev); |
| 470 | 469 | ||
| 471 | /* We must stop the state machine manually, otherwise it stops out of | 470 | /* We must stop the state machine manually, otherwise it stops out of |
| @@ -479,19 +478,18 @@ static int mdio_bus_suspend(struct device *dev) | |||
| 479 | if (!mdio_bus_phy_may_suspend(phydev)) | 478 | if (!mdio_bus_phy_may_suspend(phydev)) |
| 480 | return 0; | 479 | return 0; |
| 481 | 480 | ||
| 482 | return phydrv->suspend(phydev); | 481 | return phy_suspend(phydev); |
| 483 | } | 482 | } |
| 484 | 483 | ||
| 485 | static int mdio_bus_resume(struct device *dev) | 484 | static int mdio_bus_resume(struct device *dev) |
| 486 | { | 485 | { |
| 487 | struct phy_driver *phydrv = to_phy_driver(dev->driver); | ||
| 488 | struct phy_device *phydev = to_phy_device(dev); | 486 | struct phy_device *phydev = to_phy_device(dev); |
| 489 | int ret; | 487 | int ret; |
| 490 | 488 | ||
| 491 | if (!mdio_bus_phy_may_suspend(phydev)) | 489 | if (!mdio_bus_phy_may_suspend(phydev)) |
| 492 | goto no_resume; | 490 | goto no_resume; |
| 493 | 491 | ||
| 494 | ret = phydrv->resume(phydev); | 492 | ret = phy_resume(phydev); |
| 495 | if (ret < 0) | 493 | if (ret < 0) |
| 496 | return ret; | 494 | return ret; |
| 497 | 495 | ||
