aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/phy')
-rw-r--r--drivers/net/phy/mdio_bus.c8
-rw-r--r--drivers/net/phy/smsc.c12
2 files changed, 15 insertions, 5 deletions
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 11adf6ed4628..811a637695ca 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -296,9 +296,8 @@ static int mdio_bus_suspend(struct device * dev, pm_message_t state)
296 struct phy_driver *phydrv = to_phy_driver(drv); 296 struct phy_driver *phydrv = to_phy_driver(drv);
297 struct phy_device *phydev = to_phy_device(dev); 297 struct phy_device *phydev = to_phy_device(dev);
298 298
299 if ((!device_may_wakeup(phydev->dev.parent)) && 299 if (drv && phydrv->suspend && !device_may_wakeup(phydev->dev.parent))
300 (phydrv && phydrv->suspend)) 300 ret = phydrv->suspend(phydev);
301 ret = phydrv->suspend(phydev);
302 301
303 return ret; 302 return ret;
304} 303}
@@ -310,8 +309,7 @@ static int mdio_bus_resume(struct device * dev)
310 struct phy_driver *phydrv = to_phy_driver(drv); 309 struct phy_driver *phydrv = to_phy_driver(drv);
311 struct phy_device *phydev = to_phy_device(dev); 310 struct phy_device *phydev = to_phy_device(dev);
312 311
313 if ((!device_may_wakeup(phydev->dev.parent)) && 312 if (drv && phydrv->resume && !device_may_wakeup(phydev->dev.parent))
314 (phydrv && phydrv->resume))
315 ret = phydrv->resume(phydev); 313 ret = phydrv->resume(phydev);
316 314
317 return ret; 315 return ret;
diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
index c05d38d46350..1387187543e4 100644
--- a/drivers/net/phy/smsc.c
+++ b/drivers/net/phy/smsc.c
@@ -81,6 +81,9 @@ static struct phy_driver lan83c185_driver = {
81 .ack_interrupt = smsc_phy_ack_interrupt, 81 .ack_interrupt = smsc_phy_ack_interrupt,
82 .config_intr = smsc_phy_config_intr, 82 .config_intr = smsc_phy_config_intr,
83 83
84 .suspend = genphy_suspend,
85 .resume = genphy_resume,
86
84 .driver = { .owner = THIS_MODULE, } 87 .driver = { .owner = THIS_MODULE, }
85}; 88};
86 89
@@ -102,6 +105,9 @@ static struct phy_driver lan8187_driver = {
102 .ack_interrupt = smsc_phy_ack_interrupt, 105 .ack_interrupt = smsc_phy_ack_interrupt,
103 .config_intr = smsc_phy_config_intr, 106 .config_intr = smsc_phy_config_intr,
104 107
108 .suspend = genphy_suspend,
109 .resume = genphy_resume,
110
105 .driver = { .owner = THIS_MODULE, } 111 .driver = { .owner = THIS_MODULE, }
106}; 112};
107 113
@@ -123,6 +129,9 @@ static struct phy_driver lan8700_driver = {
123 .ack_interrupt = smsc_phy_ack_interrupt, 129 .ack_interrupt = smsc_phy_ack_interrupt,
124 .config_intr = smsc_phy_config_intr, 130 .config_intr = smsc_phy_config_intr,
125 131
132 .suspend = genphy_suspend,
133 .resume = genphy_resume,
134
126 .driver = { .owner = THIS_MODULE, } 135 .driver = { .owner = THIS_MODULE, }
127}; 136};
128 137
@@ -144,6 +153,9 @@ static struct phy_driver lan911x_int_driver = {
144 .ack_interrupt = smsc_phy_ack_interrupt, 153 .ack_interrupt = smsc_phy_ack_interrupt,
145 .config_intr = smsc_phy_config_intr, 154 .config_intr = smsc_phy_config_intr,
146 155
156 .suspend = genphy_suspend,
157 .resume = genphy_resume,
158
147 .driver = { .owner = THIS_MODULE, } 159 .driver = { .owner = THIS_MODULE, }
148}; 160};
149 161