diff options
author | Russell King <rmk@arm.linux.org.uk> | 2005-10-28 12:52:56 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-10-28 12:52:56 -0400 |
commit | 9480e307cd88ef09ec9294c7d97ebec18e6d2221 (patch) | |
tree | 967e26d3a23c24dd52b114d672312c207714308c /drivers/net | |
parent | a3a3395e487abc4c1371fe319a8ecbb3913a70a4 (diff) |
[PATCH] DRIVER MODEL: Get rid of the obsolete tri-level suspend/resume callbacks
In PM v1, all devices were called at SUSPEND_DISABLE level. Then
all devices were called at SUSPEND_SAVE_STATE level, and finally
SUSPEND_POWER_DOWN level. However, with PM v2, to maintain
compatibility for platform devices, I arranged for the PM v2
suspend/resume callbacks to call the old PM v1 suspend/resume
callbacks three times with each level in order so that existing
drivers continued to work.
Since this is obsolete infrastructure which is no longer necessary,
we can remove it. Here's an (untested) patch to do exactly that.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/dm9000.c | 8 | ||||
-rw-r--r-- | drivers/net/irda/sa1100_ir.c | 8 | ||||
-rw-r--r-- | drivers/net/irda/smsc-ircc2.c | 12 | ||||
-rw-r--r-- | drivers/net/phy/mdio_bus.c | 20 | ||||
-rw-r--r-- | drivers/net/smc91x.c | 8 |
5 files changed, 24 insertions, 32 deletions
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index e54fc10f6846..abce1f730d00 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c | |||
@@ -1140,11 +1140,11 @@ dm9000_phy_write(struct net_device *dev, int phyaddr_unused, int reg, int value) | |||
1140 | } | 1140 | } |
1141 | 1141 | ||
1142 | static int | 1142 | static int |
1143 | dm9000_drv_suspend(struct device *dev, pm_message_t state, u32 level) | 1143 | dm9000_drv_suspend(struct device *dev, pm_message_t state) |
1144 | { | 1144 | { |
1145 | struct net_device *ndev = dev_get_drvdata(dev); | 1145 | struct net_device *ndev = dev_get_drvdata(dev); |
1146 | 1146 | ||
1147 | if (ndev && level == SUSPEND_DISABLE) { | 1147 | if (ndev) { |
1148 | if (netif_running(ndev)) { | 1148 | if (netif_running(ndev)) { |
1149 | netif_device_detach(ndev); | 1149 | netif_device_detach(ndev); |
1150 | dm9000_shutdown(ndev); | 1150 | dm9000_shutdown(ndev); |
@@ -1154,12 +1154,12 @@ dm9000_drv_suspend(struct device *dev, pm_message_t state, u32 level) | |||
1154 | } | 1154 | } |
1155 | 1155 | ||
1156 | static int | 1156 | static int |
1157 | dm9000_drv_resume(struct device *dev, u32 level) | 1157 | dm9000_drv_resume(struct device *dev) |
1158 | { | 1158 | { |
1159 | struct net_device *ndev = dev_get_drvdata(dev); | 1159 | struct net_device *ndev = dev_get_drvdata(dev); |
1160 | board_info_t *db = (board_info_t *) ndev->priv; | 1160 | board_info_t *db = (board_info_t *) ndev->priv; |
1161 | 1161 | ||
1162 | if (ndev && level == RESUME_ENABLE) { | 1162 | if (ndev) { |
1163 | 1163 | ||
1164 | if (netif_running(ndev)) { | 1164 | if (netif_running(ndev)) { |
1165 | dm9000_reset(db); | 1165 | dm9000_reset(db); |
diff --git a/drivers/net/irda/sa1100_ir.c b/drivers/net/irda/sa1100_ir.c index 8d34ac60d906..06883309916d 100644 --- a/drivers/net/irda/sa1100_ir.c +++ b/drivers/net/irda/sa1100_ir.c | |||
@@ -291,12 +291,12 @@ static void sa1100_irda_shutdown(struct sa1100_irda *si) | |||
291 | /* | 291 | /* |
292 | * Suspend the IrDA interface. | 292 | * Suspend the IrDA interface. |
293 | */ | 293 | */ |
294 | static int sa1100_irda_suspend(struct device *_dev, pm_message_t state, u32 level) | 294 | static int sa1100_irda_suspend(struct device *_dev, pm_message_t state) |
295 | { | 295 | { |
296 | struct net_device *dev = dev_get_drvdata(_dev); | 296 | struct net_device *dev = dev_get_drvdata(_dev); |
297 | struct sa1100_irda *si; | 297 | struct sa1100_irda *si; |
298 | 298 | ||
299 | if (!dev || level != SUSPEND_DISABLE) | 299 | if (!dev) |
300 | return 0; | 300 | return 0; |
301 | 301 | ||
302 | si = dev->priv; | 302 | si = dev->priv; |
@@ -316,12 +316,12 @@ static int sa1100_irda_suspend(struct device *_dev, pm_message_t state, u32 leve | |||
316 | /* | 316 | /* |
317 | * Resume the IrDA interface. | 317 | * Resume the IrDA interface. |
318 | */ | 318 | */ |
319 | static int sa1100_irda_resume(struct device *_dev, u32 level) | 319 | static int sa1100_irda_resume(struct device *_dev) |
320 | { | 320 | { |
321 | struct net_device *dev = dev_get_drvdata(_dev); | 321 | struct net_device *dev = dev_get_drvdata(_dev); |
322 | struct sa1100_irda *si; | 322 | struct sa1100_irda *si; |
323 | 323 | ||
324 | if (!dev || level != RESUME_ENABLE) | 324 | if (!dev) |
325 | return 0; | 325 | return 0; |
326 | 326 | ||
327 | si = dev->priv; | 327 | si = dev->priv; |
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c index dd89bda1f131..bbac720cca63 100644 --- a/drivers/net/irda/smsc-ircc2.c +++ b/drivers/net/irda/smsc-ircc2.c | |||
@@ -213,8 +213,8 @@ static int smsc_ircc_probe_transceiver_smsc_ircc_atc(int fir_base); | |||
213 | 213 | ||
214 | /* Power Management */ | 214 | /* Power Management */ |
215 | 215 | ||
216 | static int smsc_ircc_suspend(struct device *dev, pm_message_t state, u32 level); | 216 | static int smsc_ircc_suspend(struct device *dev, pm_message_t state); |
217 | static int smsc_ircc_resume(struct device *dev, u32 level); | 217 | static int smsc_ircc_resume(struct device *dev); |
218 | 218 | ||
219 | static struct device_driver smsc_ircc_driver = { | 219 | static struct device_driver smsc_ircc_driver = { |
220 | .name = SMSC_IRCC2_DRIVER_NAME, | 220 | .name = SMSC_IRCC2_DRIVER_NAME, |
@@ -1646,13 +1646,13 @@ static int smsc_ircc_net_close(struct net_device *dev) | |||
1646 | return 0; | 1646 | return 0; |
1647 | } | 1647 | } |
1648 | 1648 | ||
1649 | static int smsc_ircc_suspend(struct device *dev, pm_message_t state, u32 level) | 1649 | static int smsc_ircc_suspend(struct device *dev, pm_message_t state) |
1650 | { | 1650 | { |
1651 | struct smsc_ircc_cb *self = dev_get_drvdata(dev); | 1651 | struct smsc_ircc_cb *self = dev_get_drvdata(dev); |
1652 | 1652 | ||
1653 | IRDA_MESSAGE("%s, Suspending\n", driver_name); | 1653 | IRDA_MESSAGE("%s, Suspending\n", driver_name); |
1654 | 1654 | ||
1655 | if (level == SUSPEND_DISABLE && !self->io.suspended) { | 1655 | if (!self->io.suspended) { |
1656 | smsc_ircc_net_close(self->netdev); | 1656 | smsc_ircc_net_close(self->netdev); |
1657 | self->io.suspended = 1; | 1657 | self->io.suspended = 1; |
1658 | } | 1658 | } |
@@ -1660,11 +1660,11 @@ static int smsc_ircc_suspend(struct device *dev, pm_message_t state, u32 level) | |||
1660 | return 0; | 1660 | return 0; |
1661 | } | 1661 | } |
1662 | 1662 | ||
1663 | static int smsc_ircc_resume(struct device *dev, u32 level) | 1663 | static int smsc_ircc_resume(struct device *dev) |
1664 | { | 1664 | { |
1665 | struct smsc_ircc_cb *self = dev_get_drvdata(dev); | 1665 | struct smsc_ircc_cb *self = dev_get_drvdata(dev); |
1666 | 1666 | ||
1667 | if (level == RESUME_ENABLE && self->io.suspended) { | 1667 | if (self->io.suspended) { |
1668 | 1668 | ||
1669 | smsc_ircc_net_open(self->netdev); | 1669 | smsc_ircc_net_open(self->netdev); |
1670 | self->io.suspended = 0; | 1670 | self->io.suspended = 0; |
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 90630672703d..ad93b0da87f0 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c | |||
@@ -133,13 +133,9 @@ static int mdio_bus_suspend(struct device * dev, pm_message_t state) | |||
133 | int ret = 0; | 133 | int ret = 0; |
134 | struct device_driver *drv = dev->driver; | 134 | struct device_driver *drv = dev->driver; |
135 | 135 | ||
136 | if (drv && drv->suspend) { | 136 | if (drv && drv->suspend) |
137 | ret = drv->suspend(dev, state, SUSPEND_DISABLE); | 137 | ret = drv->suspend(dev, state); |
138 | if (ret == 0) | 138 | |
139 | ret = drv->suspend(dev, state, SUSPEND_SAVE_STATE); | ||
140 | if (ret == 0) | ||
141 | ret = drv->suspend(dev, state, SUSPEND_POWER_DOWN); | ||
142 | } | ||
143 | return ret; | 139 | return ret; |
144 | } | 140 | } |
145 | 141 | ||
@@ -148,13 +144,9 @@ static int mdio_bus_resume(struct device * dev) | |||
148 | int ret = 0; | 144 | int ret = 0; |
149 | struct device_driver *drv = dev->driver; | 145 | struct device_driver *drv = dev->driver; |
150 | 146 | ||
151 | if (drv && drv->resume) { | 147 | if (drv && drv->resume) |
152 | ret = drv->resume(dev, RESUME_POWER_ON); | 148 | ret = drv->resume(dev); |
153 | if (ret == 0) | 149 | |
154 | ret = drv->resume(dev, RESUME_RESTORE_STATE); | ||
155 | if (ret == 0) | ||
156 | ret = drv->resume(dev, RESUME_ENABLE); | ||
157 | } | ||
158 | return ret; | 150 | return ret; |
159 | } | 151 | } |
160 | 152 | ||
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index 1438fdd20826..0ddaa611cc61 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c | |||
@@ -2291,11 +2291,11 @@ static int smc_drv_remove(struct device *dev) | |||
2291 | return 0; | 2291 | return 0; |
2292 | } | 2292 | } |
2293 | 2293 | ||
2294 | static int smc_drv_suspend(struct device *dev, pm_message_t state, u32 level) | 2294 | static int smc_drv_suspend(struct device *dev, pm_message_t state) |
2295 | { | 2295 | { |
2296 | struct net_device *ndev = dev_get_drvdata(dev); | 2296 | struct net_device *ndev = dev_get_drvdata(dev); |
2297 | 2297 | ||
2298 | if (ndev && level == SUSPEND_DISABLE) { | 2298 | if (ndev) { |
2299 | if (netif_running(ndev)) { | 2299 | if (netif_running(ndev)) { |
2300 | netif_device_detach(ndev); | 2300 | netif_device_detach(ndev); |
2301 | smc_shutdown(ndev); | 2301 | smc_shutdown(ndev); |
@@ -2305,12 +2305,12 @@ static int smc_drv_suspend(struct device *dev, pm_message_t state, u32 level) | |||
2305 | return 0; | 2305 | return 0; |
2306 | } | 2306 | } |
2307 | 2307 | ||
2308 | static int smc_drv_resume(struct device *dev, u32 level) | 2308 | static int smc_drv_resume(struct device *dev) |
2309 | { | 2309 | { |
2310 | struct platform_device *pdev = to_platform_device(dev); | 2310 | struct platform_device *pdev = to_platform_device(dev); |
2311 | struct net_device *ndev = dev_get_drvdata(dev); | 2311 | struct net_device *ndev = dev_get_drvdata(dev); |
2312 | 2312 | ||
2313 | if (ndev && level == RESUME_ENABLE) { | 2313 | if (ndev) { |
2314 | struct smc_local *lp = netdev_priv(ndev); | 2314 | struct smc_local *lp = netdev_priv(ndev); |
2315 | smc_enable_device(pdev); | 2315 | smc_enable_device(pdev); |
2316 | if (netif_running(ndev)) { | 2316 | if (netif_running(ndev)) { |