aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
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
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')
-rw-r--r--drivers/pcmcia/au1000_generic.c21
-rw-r--r--drivers/pcmcia/hd64465_ss.c20
-rw-r--r--drivers/pcmcia/i82365.c20
-rw-r--r--drivers/pcmcia/m32r_cfc.c21
-rw-r--r--drivers/pcmcia/m32r_pcc.c21
-rw-r--r--drivers/pcmcia/omap_cf.c18
-rw-r--r--drivers/pcmcia/pxa2xx_base.c26
-rw-r--r--drivers/pcmcia/sa1100_generic.c20
-rw-r--r--drivers/pcmcia/tcic.c20
-rw-r--r--drivers/pcmcia/vrc4171_card.c24
10 files changed, 25 insertions, 186 deletions
diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c
index 470ef756252e..d90a634cebf5 100644
--- a/drivers/pcmcia/au1000_generic.c
+++ b/drivers/pcmcia/au1000_generic.c
@@ -519,30 +519,13 @@ static int au1x00_drv_pcmcia_probe(struct device *dev)
519} 519}
520 520
521 521
522static int au1x00_drv_pcmcia_suspend(struct device *dev, pm_message_t state, u32 level)
523{
524 int ret = 0;
525 if (level == SUSPEND_SAVE_STATE)
526 ret = pcmcia_socket_dev_suspend(dev, state);
527 return ret;
528}
529
530static int au1x00_drv_pcmcia_resume(struct device *dev, u32 level)
531{
532 int ret = 0;
533 if (level == RESUME_RESTORE_STATE)
534 ret = pcmcia_socket_dev_resume(dev);
535 return ret;
536}
537
538
539static struct device_driver au1x00_pcmcia_driver = { 522static struct device_driver au1x00_pcmcia_driver = {
540 .probe = au1x00_drv_pcmcia_probe, 523 .probe = au1x00_drv_pcmcia_probe,
541 .remove = au1x00_drv_pcmcia_remove, 524 .remove = au1x00_drv_pcmcia_remove,
542 .name = "au1x00-pcmcia", 525 .name = "au1x00-pcmcia",
543 .bus = &platform_bus_type, 526 .bus = &platform_bus_type,
544 .suspend = au1x00_drv_pcmcia_suspend, 527 .suspend = pcmcia_socket_dev_suspend,
545 .resume = au1x00_drv_pcmcia_resume 528 .resume = pcmcia_socket_dev_resume,
546}; 529};
547 530
548static struct platform_device au1x00_device = { 531static struct platform_device au1x00_device = {
diff --git a/drivers/pcmcia/hd64465_ss.c b/drivers/pcmcia/hd64465_ss.c
index 316f8bcc878b..b57a0b98b4d6 100644
--- a/drivers/pcmcia/hd64465_ss.c
+++ b/drivers/pcmcia/hd64465_ss.c
@@ -844,27 +844,11 @@ static void hs_exit_socket(hs_socket_t *sp)
844 local_irq_restore(flags); 844 local_irq_restore(flags);
845} 845}
846 846
847static int hd64465_suspend(struct device *dev, pm_message_t state, u32 level)
848{
849 int ret = 0;
850 if (level == SUSPEND_SAVE_STATE)
851 ret = pcmcia_socket_dev_suspend(dev, state);
852 return ret;
853}
854
855static int hd64465_resume(struct device *dev, u32 level)
856{
857 int ret = 0;
858 if (level == RESUME_RESTORE_STATE)
859 ret = pcmcia_socket_dev_resume(dev);
860 return ret;
861}
862
863static struct device_driver hd64465_driver = { 847static struct device_driver hd64465_driver = {
864 .name = "hd64465-pcmcia", 848 .name = "hd64465-pcmcia",
865 .bus = &platform_bus_type, 849 .bus = &platform_bus_type,
866 .suspend = hd64465_suspend, 850 .suspend = pcmcia_socket_dev_suspend,
867 .resume = hd64465_resume, 851 .resume = pcmcia_socket_dev_resume,
868}; 852};
869 853
870static struct platform_device hd64465_device = { 854static struct platform_device hd64465_device = {
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
index a713015e8228..4a41f67d185d 100644
--- a/drivers/pcmcia/i82365.c
+++ b/drivers/pcmcia/i82365.c
@@ -1332,27 +1332,11 @@ static struct pccard_operations pcic_operations = {
1332 1332
1333/*====================================================================*/ 1333/*====================================================================*/
1334 1334
1335static int i82365_suspend(struct device *dev, pm_message_t state, u32 level)
1336{
1337 int ret = 0;
1338 if (level == SUSPEND_SAVE_STATE)
1339 ret = pcmcia_socket_dev_suspend(dev, state);
1340 return ret;
1341}
1342
1343static int i82365_resume(struct device *dev, u32 level)
1344{
1345 int ret = 0;
1346 if (level == RESUME_RESTORE_STATE)
1347 ret = pcmcia_socket_dev_resume(dev);
1348 return ret;
1349}
1350
1351static struct device_driver i82365_driver = { 1335static struct device_driver i82365_driver = {
1352 .name = "i82365", 1336 .name = "i82365",
1353 .bus = &platform_bus_type, 1337 .bus = &platform_bus_type,
1354 .suspend = i82365_suspend, 1338 .suspend = pcmcia_socket_dev_suspend,
1355 .resume = i82365_resume, 1339 .resume = pcmcia_socket_dev_resume,
1356}; 1340};
1357 1341
1358static struct platform_device i82365_device = { 1342static struct platform_device i82365_device = {
diff --git a/drivers/pcmcia/m32r_cfc.c b/drivers/pcmcia/m32r_cfc.c
index 65f3ee3d4d3c..c6ed70ea4812 100644
--- a/drivers/pcmcia/m32r_cfc.c
+++ b/drivers/pcmcia/m32r_cfc.c
@@ -731,28 +731,11 @@ static struct pccard_operations pcc_operations = {
731 731
732/*====================================================================*/ 732/*====================================================================*/
733 733
734static int m32r_pcc_suspend(struct device *dev, pm_message_t state, u32 level)
735{
736 int ret = 0;
737 if (level == SUSPEND_SAVE_STATE)
738 ret = pcmcia_socket_dev_suspend(dev, state);
739 return ret;
740}
741
742static int m32r_pcc_resume(struct device *dev, u32 level)
743{
744 int ret = 0;
745 if (level == RESUME_RESTORE_STATE)
746 ret = pcmcia_socket_dev_resume(dev);
747 return ret;
748}
749
750
751static struct device_driver pcc_driver = { 734static struct device_driver pcc_driver = {
752 .name = "cfc", 735 .name = "cfc",
753 .bus = &platform_bus_type, 736 .bus = &platform_bus_type,
754 .suspend = m32r_pcc_suspend, 737 .suspend = pcmcia_socket_dev_suspend,
755 .resume = m32r_pcc_resume, 738 .resume = pcmcia_socket_dev_resume,
756}; 739};
757 740
758static struct platform_device pcc_device = { 741static struct platform_device pcc_device = {
diff --git a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c
index 7b14d7efd68c..3397ff28de6a 100644
--- a/drivers/pcmcia/m32r_pcc.c
+++ b/drivers/pcmcia/m32r_pcc.c
@@ -695,28 +695,11 @@ static struct pccard_operations pcc_operations = {
695 695
696/*====================================================================*/ 696/*====================================================================*/
697 697
698static int m32r_pcc_suspend(struct device *dev, pm_message_t state, u32 level)
699{
700 int ret = 0;
701 if (level == SUSPEND_SAVE_STATE)
702 ret = pcmcia_socket_dev_suspend(dev, state);
703 return ret;
704}
705
706static int m32r_pcc_resume(struct device *dev, u32 level)
707{
708 int ret = 0;
709 if (level == RESUME_RESTORE_STATE)
710 ret = pcmcia_socket_dev_resume(dev);
711 return ret;
712}
713
714
715static struct device_driver pcc_driver = { 698static struct device_driver pcc_driver = {
716 .name = "pcc", 699 .name = "pcc",
717 .bus = &platform_bus_type, 700 .bus = &platform_bus_type,
718 .suspend = m32r_pcc_suspend, 701 .suspend = pcmcia_socket_dev_suspend,
719 .resume = m32r_pcc_resume, 702 .resume = pcmcia_socket_dev_resume,
720}; 703};
721 704
722static struct platform_device pcc_device = { 705static struct platform_device pcc_device = {
diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c
index 94be9e51654e..2558c3cc91ec 100644
--- a/drivers/pcmcia/omap_cf.c
+++ b/drivers/pcmcia/omap_cf.c
@@ -329,27 +329,13 @@ static int __devexit omap_cf_remove(struct device *dev)
329 return 0; 329 return 0;
330} 330}
331 331
332static int omap_cf_suspend(struct device *dev, pm_message_t mesg, u32 level)
333{
334 if (level != SUSPEND_SAVE_STATE)
335 return 0;
336 return pcmcia_socket_dev_suspend(dev, mesg);
337}
338
339static int omap_cf_resume(struct device *dev, u32 level)
340{
341 if (level != RESUME_RESTORE_STATE)
342 return 0;
343 return pcmcia_socket_dev_resume(dev);
344}
345
346static struct device_driver omap_cf_driver = { 332static struct device_driver omap_cf_driver = {
347 .name = (char *) driver_name, 333 .name = (char *) driver_name,
348 .bus = &platform_bus_type, 334 .bus = &platform_bus_type,
349 .probe = omap_cf_probe, 335 .probe = omap_cf_probe,
350 .remove = __devexit_p(omap_cf_remove), 336 .remove = __devexit_p(omap_cf_remove),
351 .suspend = omap_cf_suspend, 337 .suspend = pcmcia_socket_dev_suspend,
352 .resume = omap_cf_resume, 338 .resume = pcmcia_socket_dev_resume,
353}; 339};
354 340
355static int __init omap_cf_init(void) 341static int __init omap_cf_init(void)
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,
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c
index d4ed508b38be..b768fa81f043 100644
--- a/drivers/pcmcia/sa1100_generic.c
+++ b/drivers/pcmcia/sa1100_generic.c
@@ -74,29 +74,13 @@ static int sa11x0_drv_pcmcia_probe(struct device *dev)
74 return ret; 74 return ret;
75} 75}
76 76
77static int sa11x0_drv_pcmcia_suspend(struct device *dev, pm_message_t state, u32 level)
78{
79 int ret = 0;
80 if (level == SUSPEND_SAVE_STATE)
81 ret = pcmcia_socket_dev_suspend(dev, state);
82 return ret;
83}
84
85static int sa11x0_drv_pcmcia_resume(struct device *dev, u32 level)
86{
87 int ret = 0;
88 if (level == RESUME_RESTORE_STATE)
89 ret = pcmcia_socket_dev_resume(dev);
90 return ret;
91}
92
93static struct device_driver sa11x0_pcmcia_driver = { 77static struct device_driver sa11x0_pcmcia_driver = {
94 .probe = sa11x0_drv_pcmcia_probe, 78 .probe = sa11x0_drv_pcmcia_probe,
95 .remove = soc_common_drv_pcmcia_remove, 79 .remove = soc_common_drv_pcmcia_remove,
96 .name = "sa11x0-pcmcia", 80 .name = "sa11x0-pcmcia",
97 .bus = &platform_bus_type, 81 .bus = &platform_bus_type,
98 .suspend = sa11x0_drv_pcmcia_suspend, 82 .suspend = pcmcia_socket_dev_suspend,
99 .resume = sa11x0_drv_pcmcia_resume, 83 .resume = pcmcia_socket_dev_resume,
100}; 84};
101 85
102/* sa11x0_pcmcia_init() 86/* sa11x0_pcmcia_init()
diff --git a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c
index d5a61eae6119..f158b67f6610 100644
--- a/drivers/pcmcia/tcic.c
+++ b/drivers/pcmcia/tcic.c
@@ -372,27 +372,11 @@ static int __init get_tcic_id(void)
372 372
373/*====================================================================*/ 373/*====================================================================*/
374 374
375static int tcic_drv_suspend(struct device *dev, pm_message_t state, u32 level)
376{
377 int ret = 0;
378 if (level == SUSPEND_SAVE_STATE)
379 ret = pcmcia_socket_dev_suspend(dev, state);
380 return ret;
381}
382
383static int tcic_drv_resume(struct device *dev, u32 level)
384{
385 int ret = 0;
386 if (level == RESUME_RESTORE_STATE)
387 ret = pcmcia_socket_dev_resume(dev);
388 return ret;
389}
390
391static struct device_driver tcic_driver = { 375static struct device_driver tcic_driver = {
392 .name = "tcic-pcmcia", 376 .name = "tcic-pcmcia",
393 .bus = &platform_bus_type, 377 .bus = &platform_bus_type,
394 .suspend = tcic_drv_suspend, 378 .suspend = pcmcia_socket_dev_suspend,
395 .resume = tcic_drv_resume, 379 .resume = pcmcia_socket_dev_resume,
396}; 380};
397 381
398static struct platform_device tcic_device = { 382static struct platform_device tcic_device = {
diff --git a/drivers/pcmcia/vrc4171_card.c b/drivers/pcmcia/vrc4171_card.c
index 17bb2da6752b..3d2dca675e02 100644
--- a/drivers/pcmcia/vrc4171_card.c
+++ b/drivers/pcmcia/vrc4171_card.c
@@ -774,31 +774,11 @@ static int __devinit vrc4171_card_setup(char *options)
774 774
775__setup("vrc4171_card=", vrc4171_card_setup); 775__setup("vrc4171_card=", vrc4171_card_setup);
776 776
777static int vrc4171_card_suspend(struct device *dev, pm_message_t state, u32 level)
778{
779 int retval = 0;
780
781 if (level == SUSPEND_SAVE_STATE)
782 retval = pcmcia_socket_dev_suspend(dev, state);
783
784 return retval;
785}
786
787static int vrc4171_card_resume(struct device *dev, u32 level)
788{
789 int retval = 0;
790
791 if (level == RESUME_RESTORE_STATE)
792 retval = pcmcia_socket_dev_resume(dev);
793
794 return retval;
795}
796
797static struct device_driver vrc4171_card_driver = { 777static struct device_driver vrc4171_card_driver = {
798 .name = vrc4171_card_name, 778 .name = vrc4171_card_name,
799 .bus = &platform_bus_type, 779 .bus = &platform_bus_type,
800 .suspend = vrc4171_card_suspend, 780 .suspend = pcmcia_socket_dev_suspend,
801 .resume = vrc4171_card_resume, 781 .resume = pcmcia_socket_dev_resume,
802}; 782};
803 783
804static int __devinit vrc4171_card_init(void) 784static int __devinit vrc4171_card_init(void)