summaryrefslogtreecommitdiff
path: root/drivers/net/phy/phy_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/phy/phy_device.c')
-rw-r--r--drivers/net/phy/phy_device.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index bf02f8e..4d13745 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1043,7 +1043,7 @@ int phy_suspend(struct phy_device *phydev)
if (wol.wolopts)
return -EBUSY;
- if (phydrv->suspend)
+ if (phydev->drv && phydrv->suspend)
ret = phydrv->suspend(phydev);
if (ret)
@@ -1060,7 +1060,7 @@ int phy_resume(struct phy_device *phydev)
struct phy_driver *phydrv = to_phy_driver(phydev->mdio.dev.driver);
int ret = 0;
- if (phydrv->resume)
+ if (phydev->drv && phydrv->resume)
ret = phydrv->resume(phydev);
if (ret)
@@ -1720,7 +1720,7 @@ static int phy_remove(struct device *dev)
phydev->state = PHY_DOWN;
mutex_unlock(&phydev->lock);
- if (phydev->drv->remove)
+ if (phydev->drv && phydev->drv->remove)
phydev->drv->remove(phydev);
phydev->drv = NULL;