aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/pxa2xx_base.c
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2005-10-28 12:52:56 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-10-28 12:52:56 -0400
commit9480e307cd88ef09ec9294c7d97ebec18e6d2221 (patch)
tree967e26d3a23c24dd52b114d672312c207714308c /drivers/pcmcia/pxa2xx_base.c
parenta3a3395e487abc4c1371fe319a8ecbb3913a70a4 (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/pcmcia/pxa2xx_base.c')
-rw-r--r--drivers/pcmcia/pxa2xx_base.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index 325c992f7d8f..c2a12d53f6c7 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -205,32 +205,20 @@ int pxa2xx_drv_pcmcia_probe(struct device *dev)
205} 205}
206EXPORT_SYMBOL(pxa2xx_drv_pcmcia_probe); 206EXPORT_SYMBOL(pxa2xx_drv_pcmcia_probe);
207 207
208static int pxa2xx_drv_pcmcia_suspend(struct device *dev, pm_message_t state, u32 level) 208static int pxa2xx_drv_pcmcia_resume(struct device *dev)
209{ 209{
210 int ret = 0; 210 struct pcmcia_low_level *ops = dev->platform_data;
211 if (level == SUSPEND_SAVE_STATE) 211 int nr = ops ? ops->nr : 0;
212 ret = pcmcia_socket_dev_suspend(dev, state);
213 return ret;
214}
215 212
216static int pxa2xx_drv_pcmcia_resume(struct device *dev, u32 level) 213 MECR = nr > 1 ? MECR_CIT | MECR_NOS : (nr > 0 ? MECR_CIT : 0);
217{ 214
218 int ret = 0; 215 return pcmcia_socket_dev_resume(dev);
219 if (level == RESUME_RESTORE_STATE)
220 {
221 struct pcmcia_low_level *ops = dev->platform_data;
222 int nr = ops ? ops->nr : 0;
223
224 MECR = nr > 1 ? MECR_CIT | MECR_NOS : (nr > 0 ? MECR_CIT : 0);
225 ret = pcmcia_socket_dev_resume(dev);
226 }
227 return ret;
228} 216}
229 217
230static struct device_driver pxa2xx_pcmcia_driver = { 218static struct device_driver pxa2xx_pcmcia_driver = {
231 .probe = pxa2xx_drv_pcmcia_probe, 219 .probe = pxa2xx_drv_pcmcia_probe,
232 .remove = soc_common_drv_pcmcia_remove, 220 .remove = soc_common_drv_pcmcia_remove,
233 .suspend = pxa2xx_drv_pcmcia_suspend, 221 .suspend = pcmcia_socket_dev_suspend,
234 .resume = pxa2xx_drv_pcmcia_resume, 222 .resume = pxa2xx_drv_pcmcia_resume,
235 .name = "pxa2xx-pcmcia", 223 .name = "pxa2xx-pcmcia",
236 .bus = &platform_bus_type, 224 .bus = &platform_bus_type,