aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-03-26 18:11:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-26 18:11:20 -0400
commit6f063aea557f66eea8c35034a25df85cae5ced33 (patch)
tree326fefee4ba268d27e7b686a4af4e7a35b008428
parentf3845f3f6081b97ebc4dc905e097c07e868017b5 (diff)
parentd7646f7632549124fe70fec8af834c7c1246f365 (diff)
Merge branch 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: pcmcia: use dev_pm_ops for class pcmcia_socket_class power: support _noirq actions on device types and classes pcmcia: allow for four multifunction subdevices (again) pcmcia: do not use ioports < 0x100 on x86 pd6729: Coding Style fixes
-rw-r--r--drivers/base/power/main.c31
-rw-r--r--drivers/pcmcia/at91_cf.c2
-rw-r--r--drivers/pcmcia/au1000_generic.c13
-rw-r--r--drivers/pcmcia/bfin_cf_pcmcia.c12
-rw-r--r--drivers/pcmcia/cs.c124
-rw-r--r--drivers/pcmcia/db1xxx_ss.c27
-rw-r--r--drivers/pcmcia/ds.c8
-rw-r--r--drivers/pcmcia/i82092.c16
-rw-r--r--drivers/pcmcia/i82365.c11
-rw-r--r--drivers/pcmcia/m32r_cfc.c11
-rw-r--r--drivers/pcmcia/m32r_pcc.c12
-rw-r--r--drivers/pcmcia/m8xx_pcmcia.c17
-rw-r--r--drivers/pcmcia/omap_cf.c12
-rw-r--r--drivers/pcmcia/pd6729.c80
-rw-r--r--drivers/pcmcia/pxa2xx_base.c8
-rw-r--r--drivers/pcmcia/rsrc_nonstatic.c7
-rw-r--r--drivers/pcmcia/sa1100_generic.c13
-rw-r--r--drivers/pcmcia/sa1111_generic.c12
-rw-r--r--drivers/pcmcia/tcic.c12
-rw-r--r--drivers/pcmcia/vrc4171_card.c13
-rw-r--r--drivers/pcmcia/yenta_socket.c17
-rw-r--r--include/pcmcia/ss.h6
22 files changed, 149 insertions, 315 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index d477f4dc5e51..941fcb87e52a 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -439,8 +439,23 @@ static int device_resume_noirq(struct device *dev, pm_message_t state)
439 if (dev->bus && dev->bus->pm) { 439 if (dev->bus && dev->bus->pm) {
440 pm_dev_dbg(dev, state, "EARLY "); 440 pm_dev_dbg(dev, state, "EARLY ");
441 error = pm_noirq_op(dev, dev->bus->pm, state); 441 error = pm_noirq_op(dev, dev->bus->pm, state);
442 if (error)
443 goto End;
442 } 444 }
443 445
446 if (dev->type && dev->type->pm) {
447 pm_dev_dbg(dev, state, "EARLY type ");
448 error = pm_noirq_op(dev, dev->type->pm, state);
449 if (error)
450 goto End;
451 }
452
453 if (dev->class && dev->class->pm) {
454 pm_dev_dbg(dev, state, "EARLY class ");
455 error = pm_noirq_op(dev, dev->class->pm, state);
456 }
457
458End:
444 TRACE_RESUME(error); 459 TRACE_RESUME(error);
445 return error; 460 return error;
446} 461}
@@ -735,10 +750,26 @@ static int device_suspend_noirq(struct device *dev, pm_message_t state)
735{ 750{
736 int error = 0; 751 int error = 0;
737 752
753 if (dev->class && dev->class->pm) {
754 pm_dev_dbg(dev, state, "LATE class ");
755 error = pm_noirq_op(dev, dev->class->pm, state);
756 if (error)
757 goto End;
758 }
759
760 if (dev->type && dev->type->pm) {
761 pm_dev_dbg(dev, state, "LATE type ");
762 error = pm_noirq_op(dev, dev->type->pm, state);
763 if (error)
764 goto End;
765 }
766
738 if (dev->bus && dev->bus->pm) { 767 if (dev->bus && dev->bus->pm) {
739 pm_dev_dbg(dev, state, "LATE "); 768 pm_dev_dbg(dev, state, "LATE ");
740 error = pm_noirq_op(dev, dev->bus->pm, state); 769 error = pm_noirq_op(dev, dev->bus->pm, state);
741 } 770 }
771
772End:
742 return error; 773 return error;
743} 774}
744 775
diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c
index 5d228071ec69..fb904f444d90 100644
--- a/drivers/pcmcia/at91_cf.c
+++ b/drivers/pcmcia/at91_cf.c
@@ -361,7 +361,6 @@ static int at91_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
361 struct at91_cf_socket *cf = platform_get_drvdata(pdev); 361 struct at91_cf_socket *cf = platform_get_drvdata(pdev);
362 struct at91_cf_data *board = cf->board; 362 struct at91_cf_data *board = cf->board;
363 363
364 pcmcia_socket_dev_suspend(&pdev->dev);
365 if (device_may_wakeup(&pdev->dev)) { 364 if (device_may_wakeup(&pdev->dev)) {
366 enable_irq_wake(board->det_pin); 365 enable_irq_wake(board->det_pin);
367 if (board->irq_pin) 366 if (board->irq_pin)
@@ -381,7 +380,6 @@ static int at91_cf_resume(struct platform_device *pdev)
381 disable_irq_wake(board->irq_pin); 380 disable_irq_wake(board->irq_pin);
382 } 381 }
383 382
384 pcmcia_socket_dev_resume(&pdev->dev);
385 return 0; 383 return 0;
386} 384}
387 385
diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c
index 171c8a654887..ac4d089430fd 100644
--- a/drivers/pcmcia/au1000_generic.c
+++ b/drivers/pcmcia/au1000_generic.c
@@ -510,17 +510,6 @@ static int au1x00_drv_pcmcia_probe(struct platform_device *dev)
510 return ret; 510 return ret;
511} 511}
512 512
513static int au1x00_drv_pcmcia_suspend(struct platform_device *dev,
514 pm_message_t state)
515{
516 return pcmcia_socket_dev_suspend(&dev->dev);
517}
518
519static int au1x00_drv_pcmcia_resume(struct platform_device *dev)
520{
521 return pcmcia_socket_dev_resume(&dev->dev);
522}
523
524static struct platform_driver au1x00_pcmcia_driver = { 513static struct platform_driver au1x00_pcmcia_driver = {
525 .driver = { 514 .driver = {
526 .name = "au1x00-pcmcia", 515 .name = "au1x00-pcmcia",
@@ -528,8 +517,6 @@ static struct platform_driver au1x00_pcmcia_driver = {
528 }, 517 },
529 .probe = au1x00_drv_pcmcia_probe, 518 .probe = au1x00_drv_pcmcia_probe,
530 .remove = au1x00_drv_pcmcia_remove, 519 .remove = au1x00_drv_pcmcia_remove,
531 .suspend = au1x00_drv_pcmcia_suspend,
532 .resume = au1x00_drv_pcmcia_resume,
533}; 520};
534 521
535 522
diff --git a/drivers/pcmcia/bfin_cf_pcmcia.c b/drivers/pcmcia/bfin_cf_pcmcia.c
index 2482ce7ac6dc..93f9ddeb0c36 100644
--- a/drivers/pcmcia/bfin_cf_pcmcia.c
+++ b/drivers/pcmcia/bfin_cf_pcmcia.c
@@ -300,16 +300,6 @@ static int __devexit bfin_cf_remove(struct platform_device *pdev)
300 return 0; 300 return 0;
301} 301}
302 302
303static int bfin_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
304{
305 return pcmcia_socket_dev_suspend(&pdev->dev);
306}
307
308static int bfin_cf_resume(struct platform_device *pdev)
309{
310 return pcmcia_socket_dev_resume(&pdev->dev);
311}
312
313static struct platform_driver bfin_cf_driver = { 303static struct platform_driver bfin_cf_driver = {
314 .driver = { 304 .driver = {
315 .name = (char *)driver_name, 305 .name = (char *)driver_name,
@@ -317,8 +307,6 @@ static struct platform_driver bfin_cf_driver = {
317 }, 307 },
318 .probe = bfin_cf_probe, 308 .probe = bfin_cf_probe,
319 .remove = __devexit_p(bfin_cf_remove), 309 .remove = __devexit_p(bfin_cf_remove),
320 .suspend = bfin_cf_suspend,
321 .resume = bfin_cf_resume,
322}; 310};
323 311
324static int __init bfin_cf_init(void) 312static int __init bfin_cf_init(void)
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index e679e708db63..75ed866e6953 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -76,65 +76,6 @@ DECLARE_RWSEM(pcmcia_socket_list_rwsem);
76EXPORT_SYMBOL(pcmcia_socket_list_rwsem); 76EXPORT_SYMBOL(pcmcia_socket_list_rwsem);
77 77
78 78
79/*
80 * Low-level PCMCIA socket drivers need to register with the PCCard
81 * core using pcmcia_register_socket.
82 *
83 * socket drivers are expected to use the following callbacks in their
84 * .drv struct:
85 * - pcmcia_socket_dev_suspend
86 * - pcmcia_socket_dev_resume
87 * These functions check for the appropriate struct pcmcia_soket arrays,
88 * and pass them to the low-level functions pcmcia_{suspend,resume}_socket
89 */
90static int socket_early_resume(struct pcmcia_socket *skt);
91static int socket_late_resume(struct pcmcia_socket *skt);
92static int socket_resume(struct pcmcia_socket *skt);
93static int socket_suspend(struct pcmcia_socket *skt);
94
95static void pcmcia_socket_dev_run(struct device *dev,
96 int (*cb)(struct pcmcia_socket *))
97{
98 struct pcmcia_socket *socket;
99
100 down_read(&pcmcia_socket_list_rwsem);
101 list_for_each_entry(socket, &pcmcia_socket_list, socket_list) {
102 if (socket->dev.parent != dev)
103 continue;
104 mutex_lock(&socket->skt_mutex);
105 cb(socket);
106 mutex_unlock(&socket->skt_mutex);
107 }
108 up_read(&pcmcia_socket_list_rwsem);
109}
110
111int pcmcia_socket_dev_suspend(struct device *dev)
112{
113 pcmcia_socket_dev_run(dev, socket_suspend);
114 return 0;
115}
116EXPORT_SYMBOL(pcmcia_socket_dev_suspend);
117
118void pcmcia_socket_dev_early_resume(struct device *dev)
119{
120 pcmcia_socket_dev_run(dev, socket_early_resume);
121}
122EXPORT_SYMBOL(pcmcia_socket_dev_early_resume);
123
124void pcmcia_socket_dev_late_resume(struct device *dev)
125{
126 pcmcia_socket_dev_run(dev, socket_late_resume);
127}
128EXPORT_SYMBOL(pcmcia_socket_dev_late_resume);
129
130int pcmcia_socket_dev_resume(struct device *dev)
131{
132 pcmcia_socket_dev_run(dev, socket_resume);
133 return 0;
134}
135EXPORT_SYMBOL(pcmcia_socket_dev_resume);
136
137
138struct pcmcia_socket *pcmcia_get_socket(struct pcmcia_socket *skt) 79struct pcmcia_socket *pcmcia_get_socket(struct pcmcia_socket *skt)
139{ 80{
140 struct device *dev = get_device(&skt->dev); 81 struct device *dev = get_device(&skt->dev);
@@ -578,12 +519,18 @@ static int socket_early_resume(struct pcmcia_socket *skt)
578 519
579static int socket_late_resume(struct pcmcia_socket *skt) 520static int socket_late_resume(struct pcmcia_socket *skt)
580{ 521{
522 int ret;
523
581 mutex_lock(&skt->ops_mutex); 524 mutex_lock(&skt->ops_mutex);
582 skt->state &= ~SOCKET_SUSPEND; 525 skt->state &= ~SOCKET_SUSPEND;
583 mutex_unlock(&skt->ops_mutex); 526 mutex_unlock(&skt->ops_mutex);
584 527
585 if (!(skt->state & SOCKET_PRESENT)) 528 if (!(skt->state & SOCKET_PRESENT)) {
586 return socket_insert(skt); 529 ret = socket_insert(skt);
530 if (ret == -ENODEV)
531 ret = 0;
532 return ret;
533 }
587 534
588 if (skt->resume_status) { 535 if (skt->resume_status) {
589 socket_shutdown(skt); 536 socket_shutdown(skt);
@@ -919,11 +866,66 @@ static void pcmcia_release_socket_class(struct class *data)
919} 866}
920 867
921 868
869#ifdef CONFIG_PM
870
871static int __pcmcia_pm_op(struct device *dev,
872 int (*callback) (struct pcmcia_socket *skt))
873{
874 struct pcmcia_socket *s = container_of(dev, struct pcmcia_socket, dev);
875 int ret;
876
877 mutex_lock(&s->skt_mutex);
878 ret = callback(s);
879 mutex_unlock(&s->skt_mutex);
880
881 return ret;
882}
883
884static int pcmcia_socket_dev_suspend_noirq(struct device *dev)
885{
886 return __pcmcia_pm_op(dev, socket_suspend);
887}
888
889static int pcmcia_socket_dev_resume_noirq(struct device *dev)
890{
891 return __pcmcia_pm_op(dev, socket_early_resume);
892}
893
894static int pcmcia_socket_dev_resume(struct device *dev)
895{
896 return __pcmcia_pm_op(dev, socket_late_resume);
897}
898
899static const struct dev_pm_ops pcmcia_socket_pm_ops = {
900 /* dev_resume may be called with IRQs enabled */
901 SET_SYSTEM_SLEEP_PM_OPS(NULL,
902 pcmcia_socket_dev_resume)
903
904 /* late suspend must be called with IRQs disabled */
905 .suspend_noirq = pcmcia_socket_dev_suspend_noirq,
906 .freeze_noirq = pcmcia_socket_dev_suspend_noirq,
907 .poweroff_noirq = pcmcia_socket_dev_suspend_noirq,
908
909 /* early resume must be called with IRQs disabled */
910 .resume_noirq = pcmcia_socket_dev_resume_noirq,
911 .thaw_noirq = pcmcia_socket_dev_resume_noirq,
912 .restore_noirq = pcmcia_socket_dev_resume_noirq,
913};
914
915#define PCMCIA_SOCKET_CLASS_PM_OPS (&pcmcia_socket_pm_ops)
916
917#else /* CONFIG_PM */
918
919#define PCMCIA_SOCKET_CLASS_PM_OPS NULL
920
921#endif /* CONFIG_PM */
922
922struct class pcmcia_socket_class = { 923struct class pcmcia_socket_class = {
923 .name = "pcmcia_socket", 924 .name = "pcmcia_socket",
924 .dev_uevent = pcmcia_socket_uevent, 925 .dev_uevent = pcmcia_socket_uevent,
925 .dev_release = pcmcia_release_socket, 926 .dev_release = pcmcia_release_socket,
926 .class_release = pcmcia_release_socket_class, 927 .class_release = pcmcia_release_socket_class,
928 .pm = PCMCIA_SOCKET_CLASS_PM_OPS,
927}; 929};
928EXPORT_SYMBOL(pcmcia_socket_class); 930EXPORT_SYMBOL(pcmcia_socket_class);
929 931
diff --git a/drivers/pcmcia/db1xxx_ss.c b/drivers/pcmcia/db1xxx_ss.c
index 9254ab0b29b1..a520193b6453 100644
--- a/drivers/pcmcia/db1xxx_ss.c
+++ b/drivers/pcmcia/db1xxx_ss.c
@@ -558,37 +558,10 @@ static int __devexit db1x_pcmcia_socket_remove(struct platform_device *pdev)
558 return 0; 558 return 0;
559} 559}
560 560
561#ifdef CONFIG_PM
562static int db1x_pcmcia_suspend(struct device *dev)
563{
564 return pcmcia_socket_dev_suspend(dev);
565}
566
567static int db1x_pcmcia_resume(struct device *dev)
568{
569 return pcmcia_socket_dev_resume(dev);
570}
571
572static struct dev_pm_ops db1x_pcmcia_pmops = {
573 .resume = db1x_pcmcia_resume,
574 .suspend = db1x_pcmcia_suspend,
575 .thaw = db1x_pcmcia_resume,
576 .freeze = db1x_pcmcia_suspend,
577};
578
579#define DB1XXX_SS_PMOPS &db1x_pcmcia_pmops
580
581#else
582
583#define DB1XXX_SS_PMOPS NULL
584
585#endif
586
587static struct platform_driver db1x_pcmcia_socket_driver = { 561static struct platform_driver db1x_pcmcia_socket_driver = {
588 .driver = { 562 .driver = {
589 .name = "db1xxx_pcmcia", 563 .name = "db1xxx_pcmcia",
590 .owner = THIS_MODULE, 564 .owner = THIS_MODULE,
591 .pm = DB1XXX_SS_PMOPS
592 }, 565 },
593 .probe = db1x_pcmcia_socket_probe, 566 .probe = db1x_pcmcia_socket_probe,
594 .remove = __devexit_p(db1x_pcmcia_socket_remove), 567 .remove = __devexit_p(db1x_pcmcia_socket_remove),
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index ad93ebd7b2a2..52d33b2a5bc5 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -509,8 +509,12 @@ struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, unsigned int fu
509 p_dev->device_no = (s->device_count++); 509 p_dev->device_no = (s->device_count++);
510 mutex_unlock(&s->ops_mutex); 510 mutex_unlock(&s->ops_mutex);
511 511
512 /* max of 2 devices per card */ 512 /* max of 2 PFC devices */
513 if (p_dev->device_no >= 2) 513 if ((p_dev->device_no >= 2) && (function == 0))
514 goto err_free;
515
516 /* max of 4 devices overall */
517 if (p_dev->device_no >= 4)
514 goto err_free; 518 goto err_free;
515 519
516 p_dev->socket = s; 520 p_dev->socket = s;
diff --git a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c
index f5da62653313..3003bb3dfcc0 100644
--- a/drivers/pcmcia/i82092.c
+++ b/drivers/pcmcia/i82092.c
@@ -39,27 +39,11 @@ static struct pci_device_id i82092aa_pci_ids[] = {
39}; 39};
40MODULE_DEVICE_TABLE(pci, i82092aa_pci_ids); 40MODULE_DEVICE_TABLE(pci, i82092aa_pci_ids);
41 41
42#ifdef CONFIG_PM
43static int i82092aa_socket_suspend (struct pci_dev *dev, pm_message_t state)
44{
45 return pcmcia_socket_dev_suspend(&dev->dev);
46}
47
48static int i82092aa_socket_resume (struct pci_dev *dev)
49{
50 return pcmcia_socket_dev_resume(&dev->dev);
51}
52#endif
53
54static struct pci_driver i82092aa_pci_driver = { 42static struct pci_driver i82092aa_pci_driver = {
55 .name = "i82092aa", 43 .name = "i82092aa",
56 .id_table = i82092aa_pci_ids, 44 .id_table = i82092aa_pci_ids,
57 .probe = i82092aa_pci_probe, 45 .probe = i82092aa_pci_probe,
58 .remove = __devexit_p(i82092aa_pci_remove), 46 .remove = __devexit_p(i82092aa_pci_remove),
59#ifdef CONFIG_PM
60 .suspend = i82092aa_socket_suspend,
61 .resume = i82092aa_socket_resume,
62#endif
63}; 47};
64 48
65 49
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
index c13fd9360511..d53d9b5659c7 100644
--- a/drivers/pcmcia/i82365.c
+++ b/drivers/pcmcia/i82365.c
@@ -1223,16 +1223,7 @@ static int pcic_init(struct pcmcia_socket *s)
1223 return 0; 1223 return 0;
1224} 1224}
1225 1225
1226static int i82365_drv_pcmcia_suspend(struct platform_device *dev,
1227 pm_message_t state)
1228{
1229 return pcmcia_socket_dev_suspend(&dev->dev);
1230}
1231 1226
1232static int i82365_drv_pcmcia_resume(struct platform_device *dev)
1233{
1234 return pcmcia_socket_dev_resume(&dev->dev);
1235}
1236static struct pccard_operations pcic_operations = { 1227static struct pccard_operations pcic_operations = {
1237 .init = pcic_init, 1228 .init = pcic_init,
1238 .get_status = pcic_get_status, 1229 .get_status = pcic_get_status,
@@ -1248,8 +1239,6 @@ static struct platform_driver i82365_driver = {
1248 .name = "i82365", 1239 .name = "i82365",
1249 .owner = THIS_MODULE, 1240 .owner = THIS_MODULE,
1250 }, 1241 },
1251 .suspend = i82365_drv_pcmcia_suspend,
1252 .resume = i82365_drv_pcmcia_resume,
1253}; 1242};
1254 1243
1255static struct platform_device *i82365_device; 1244static struct platform_device *i82365_device;
diff --git a/drivers/pcmcia/m32r_cfc.c b/drivers/pcmcia/m32r_cfc.c
index 0ece2cd4a85e..ab21264468d6 100644
--- a/drivers/pcmcia/m32r_cfc.c
+++ b/drivers/pcmcia/m32r_cfc.c
@@ -685,16 +685,7 @@ static struct pccard_operations pcc_operations = {
685 .set_mem_map = pcc_set_mem_map, 685 .set_mem_map = pcc_set_mem_map,
686}; 686};
687 687
688static int cfc_drv_pcmcia_suspend(struct platform_device *dev,
689 pm_message_t state)
690{
691 return pcmcia_socket_dev_suspend(&dev->dev);
692}
693 688
694static int cfc_drv_pcmcia_resume(struct platform_device *dev)
695{
696 return pcmcia_socket_dev_resume(&dev->dev);
697}
698/*====================================================================*/ 689/*====================================================================*/
699 690
700static struct platform_driver pcc_driver = { 691static struct platform_driver pcc_driver = {
@@ -702,8 +693,6 @@ static struct platform_driver pcc_driver = {
702 .name = "cfc", 693 .name = "cfc",
703 .owner = THIS_MODULE, 694 .owner = THIS_MODULE,
704 }, 695 },
705 .suspend = cfc_drv_pcmcia_suspend,
706 .resume = cfc_drv_pcmcia_resume,
707}; 696};
708 697
709static struct platform_device pcc_device = { 698static struct platform_device pcc_device = {
diff --git a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c
index 72844c5a6d05..0caf3db7c700 100644
--- a/drivers/pcmcia/m32r_pcc.c
+++ b/drivers/pcmcia/m32r_pcc.c
@@ -663,16 +663,6 @@ static struct pccard_operations pcc_operations = {
663 .set_mem_map = pcc_set_mem_map, 663 .set_mem_map = pcc_set_mem_map,
664}; 664};
665 665
666static int pcc_drv_pcmcia_suspend(struct platform_device *dev,
667 pm_message_t state)
668{
669 return pcmcia_socket_dev_suspend(&dev->dev);
670}
671
672static int pcc_drv_pcmcia_resume(struct platform_device *dev)
673{
674 return pcmcia_socket_dev_resume(&dev->dev);
675}
676/*====================================================================*/ 666/*====================================================================*/
677 667
678static struct platform_driver pcc_driver = { 668static struct platform_driver pcc_driver = {
@@ -680,8 +670,6 @@ static struct platform_driver pcc_driver = {
680 .name = "pcc", 670 .name = "pcc",
681 .owner = THIS_MODULE, 671 .owner = THIS_MODULE,
682 }, 672 },
683 .suspend = pcc_drv_pcmcia_suspend,
684 .resume = pcc_drv_pcmcia_resume,
685}; 673};
686 674
687static struct platform_device pcc_device = { 675static struct platform_device pcc_device = {
diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c
index 61c215918128..01ef7de15322 100644
--- a/drivers/pcmcia/m8xx_pcmcia.c
+++ b/drivers/pcmcia/m8xx_pcmcia.c
@@ -1288,21 +1288,6 @@ static int m8xx_remove(struct of_device *ofdev)
1288 return 0; 1288 return 0;
1289} 1289}
1290 1290
1291#ifdef CONFIG_PM
1292static int m8xx_suspend(struct platform_device *pdev, pm_message_t state)
1293{
1294 return pcmcia_socket_dev_suspend(&pdev->dev);
1295}
1296
1297static int m8xx_resume(struct platform_device *pdev)
1298{
1299 return pcmcia_socket_dev_resume(&pdev->dev);
1300}
1301#else
1302#define m8xx_suspend NULL
1303#define m8xx_resume NULL
1304#endif
1305
1306static const struct of_device_id m8xx_pcmcia_match[] = { 1291static const struct of_device_id m8xx_pcmcia_match[] = {
1307 { 1292 {
1308 .type = "pcmcia", 1293 .type = "pcmcia",
@@ -1318,8 +1303,6 @@ static struct of_platform_driver m8xx_pcmcia_driver = {
1318 .match_table = m8xx_pcmcia_match, 1303 .match_table = m8xx_pcmcia_match,
1319 .probe = m8xx_probe, 1304 .probe = m8xx_probe,
1320 .remove = m8xx_remove, 1305 .remove = m8xx_remove,
1321 .suspend = m8xx_suspend,
1322 .resume = m8xx_resume,
1323}; 1306};
1324 1307
1325static int __init m8xx_init(void) 1308static int __init m8xx_init(void)
diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c
index 3ef991552398..9edc396577b9 100644
--- a/drivers/pcmcia/omap_cf.c
+++ b/drivers/pcmcia/omap_cf.c
@@ -330,24 +330,12 @@ static int __exit omap_cf_remove(struct platform_device *pdev)
330 return 0; 330 return 0;
331} 331}
332 332
333static int omap_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
334{
335 return pcmcia_socket_dev_suspend(&pdev->dev);
336}
337
338static int omap_cf_resume(struct platform_device *pdev)
339{
340 return pcmcia_socket_dev_resume(&pdev->dev);
341}
342
343static struct platform_driver omap_cf_driver = { 333static struct platform_driver omap_cf_driver = {
344 .driver = { 334 .driver = {
345 .name = (char *) driver_name, 335 .name = (char *) driver_name,
346 .owner = THIS_MODULE, 336 .owner = THIS_MODULE,
347 }, 337 },
348 .remove = __exit_p(omap_cf_remove), 338 .remove = __exit_p(omap_cf_remove),
349 .suspend = omap_cf_suspend,
350 .resume = omap_cf_resume,
351}; 339};
352 340
353static int __init omap_cf_init(void) 341static int __init omap_cf_init(void)
diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
index 7ba57a565cd7..4a34268cc512 100644
--- a/drivers/pcmcia/pd6729.c
+++ b/drivers/pcmcia/pd6729.c
@@ -14,13 +14,13 @@
14#include <linux/workqueue.h> 14#include <linux/workqueue.h>
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16#include <linux/device.h> 16#include <linux/device.h>
17#include <linux/io.h>
17 18
18#include <pcmcia/cs_types.h> 19#include <pcmcia/cs_types.h>
19#include <pcmcia/ss.h> 20#include <pcmcia/ss.h>
20#include <pcmcia/cs.h> 21#include <pcmcia/cs.h>
21 22
22#include <asm/system.h> 23#include <asm/system.h>
23#include <asm/io.h>
24 24
25#include "pd6729.h" 25#include "pd6729.h"
26#include "i82365.h" 26#include "i82365.h"
@@ -222,9 +222,9 @@ static irqreturn_t pd6729_interrupt(int irq, void *dev)
222 ? SS_READY : 0; 222 ? SS_READY : 0;
223 } 223 }
224 224
225 if (events) { 225 if (events)
226 pcmcia_parse_events(&socket[i].socket, events); 226 pcmcia_parse_events(&socket[i].socket, events);
227 } 227
228 active |= events; 228 active |= events;
229 } 229 }
230 230
@@ -256,9 +256,8 @@ static int pd6729_get_status(struct pcmcia_socket *sock, u_int *value)
256 status = indirect_read(socket, I365_STATUS); 256 status = indirect_read(socket, I365_STATUS);
257 *value = 0; 257 *value = 0;
258 258
259 if ((status & I365_CS_DETECT) == I365_CS_DETECT) { 259 if ((status & I365_CS_DETECT) == I365_CS_DETECT)
260 *value |= SS_DETECT; 260 *value |= SS_DETECT;
261 }
262 261
263 /* 262 /*
264 * IO cards have a different meaning of bits 0,1 263 * IO cards have a different meaning of bits 0,1
@@ -308,7 +307,7 @@ static int pd6729_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
308 socket->card_irq = state->io_irq; 307 socket->card_irq = state->io_irq;
309 308
310 reg = 0; 309 reg = 0;
311 /* The reset bit has "inverse" logic */ 310 /* The reset bit has "inverse" logic */
312 if (!(state->flags & SS_RESET)) 311 if (!(state->flags & SS_RESET))
313 reg |= I365_PC_RESET; 312 reg |= I365_PC_RESET;
314 if (state->flags & SS_IOCARD) 313 if (state->flags & SS_IOCARD)
@@ -380,7 +379,7 @@ static int pd6729_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
380 indirect_write(socket, I365_POWER, reg); 379 indirect_write(socket, I365_POWER, reg);
381 380
382 if (irq_mode == 1) { 381 if (irq_mode == 1) {
383 /* all interrupts are to be done as PCI interrupts */ 382 /* all interrupts are to be done as PCI interrupts */
384 data = PD67_EC1_INV_MGMT_IRQ | PD67_EC1_INV_CARD_IRQ; 383 data = PD67_EC1_INV_MGMT_IRQ | PD67_EC1_INV_CARD_IRQ;
385 } else 384 } else
386 data = 0; 385 data = 0;
@@ -391,9 +390,9 @@ static int pd6729_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
391 /* Enable specific interrupt events */ 390 /* Enable specific interrupt events */
392 391
393 reg = 0x00; 392 reg = 0x00;
394 if (state->csc_mask & SS_DETECT) { 393 if (state->csc_mask & SS_DETECT)
395 reg |= I365_CSC_DETECT; 394 reg |= I365_CSC_DETECT;
396 } 395
397 if (state->flags & SS_IOCARD) { 396 if (state->flags & SS_IOCARD) {
398 if (state->csc_mask & SS_STSCHG) 397 if (state->csc_mask & SS_STSCHG)
399 reg |= I365_CSC_STSCHG; 398 reg |= I365_CSC_STSCHG;
@@ -450,9 +449,12 @@ static int pd6729_set_io_map(struct pcmcia_socket *sock,
450 449
451 ioctl = indirect_read(socket, I365_IOCTL) & ~I365_IOCTL_MASK(map); 450 ioctl = indirect_read(socket, I365_IOCTL) & ~I365_IOCTL_MASK(map);
452 451
453 if (io->flags & MAP_0WS) ioctl |= I365_IOCTL_0WS(map); 452 if (io->flags & MAP_0WS)
454 if (io->flags & MAP_16BIT) ioctl |= I365_IOCTL_16BIT(map); 453 ioctl |= I365_IOCTL_0WS(map);
455 if (io->flags & MAP_AUTOSZ) ioctl |= I365_IOCTL_IOCS16(map); 454 if (io->flags & MAP_16BIT)
455 ioctl |= I365_IOCTL_16BIT(map);
456 if (io->flags & MAP_AUTOSZ)
457 ioctl |= I365_IOCTL_IOCS16(map);
456 458
457 indirect_write(socket, I365_IOCTL, ioctl); 459 indirect_write(socket, I365_IOCTL, ioctl);
458 460
@@ -497,7 +499,7 @@ static int pd6729_set_mem_map(struct pcmcia_socket *sock,
497 499
498 /* write the stop address */ 500 /* write the stop address */
499 501
500 i= (mem->res->end >> 12) & 0x0fff; 502 i = (mem->res->end >> 12) & 0x0fff;
501 switch (to_cycles(mem->speed)) { 503 switch (to_cycles(mem->speed)) {
502 case 0: 504 case 0:
503 break; 505 break;
@@ -563,7 +565,7 @@ static int pd6729_init(struct pcmcia_socket *sock)
563 565
564/* the pccard structure and its functions */ 566/* the pccard structure and its functions */
565static struct pccard_operations pd6729_operations = { 567static struct pccard_operations pd6729_operations = {
566 .init = pd6729_init, 568 .init = pd6729_init,
567 .get_status = pd6729_get_status, 569 .get_status = pd6729_get_status,
568 .set_socket = pd6729_set_socket, 570 .set_socket = pd6729_set_socket,
569 .set_io_map = pd6729_set_io_map, 571 .set_io_map = pd6729_set_io_map,
@@ -578,8 +580,13 @@ static irqreturn_t pd6729_test(int irq, void *dev)
578 580
579static int pd6729_check_irq(int irq) 581static int pd6729_check_irq(int irq)
580{ 582{
581 if (request_irq(irq, pd6729_test, IRQF_PROBE_SHARED, "x", pd6729_test) 583 int ret;
582 != 0) return -1; 584
585 ret = request_irq(irq, pd6729_test, IRQF_PROBE_SHARED, "x",
586 pd6729_test);
587 if (ret)
588 return -1;
589
583 free_irq(irq, pd6729_test); 590 free_irq(irq, pd6729_test);
584 return 0; 591 return 0;
585} 592}
@@ -591,7 +598,7 @@ static u_int __devinit pd6729_isa_scan(void)
591 598
592 if (irq_mode == 1) { 599 if (irq_mode == 1) {
593 printk(KERN_INFO "pd6729: PCI card interrupts, " 600 printk(KERN_INFO "pd6729: PCI card interrupts, "
594 "PCI status changes\n"); 601 "PCI status changes\n");
595 return 0; 602 return 0;
596 } 603 }
597 604
@@ -607,9 +614,10 @@ static u_int __devinit pd6729_isa_scan(void)
607 if (mask & (1<<i)) 614 if (mask & (1<<i))
608 printk("%s%d", ((mask & ((1<<i)-1)) ? "," : ""), i); 615 printk("%s%d", ((mask & ((1<<i)-1)) ? "," : ""), i);
609 616
610 if (mask == 0) printk("none!"); 617 if (mask == 0)
611 618 printk("none!");
612 printk(" polling status changes.\n"); 619 else
620 printk(" polling status changes.\n");
613 621
614 return mask; 622 return mask;
615} 623}
@@ -624,11 +632,16 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev,
624 632
625 socket = kzalloc(sizeof(struct pd6729_socket) * MAX_SOCKETS, 633 socket = kzalloc(sizeof(struct pd6729_socket) * MAX_SOCKETS,
626 GFP_KERNEL); 634 GFP_KERNEL);
627 if (!socket) 635 if (!socket) {
636 dev_warn(&dev->dev, "failed to kzalloc socket.\n");
628 return -ENOMEM; 637 return -ENOMEM;
638 }
629 639
630 if ((ret = pci_enable_device(dev))) 640 ret = pci_enable_device(dev);
641 if (ret) {
642 dev_warn(&dev->dev, "failed to enable pci_device.\n");
631 goto err_out_free_mem; 643 goto err_out_free_mem;
644 }
632 645
633 if (!pci_resource_start(dev, 0)) { 646 if (!pci_resource_start(dev, 0)) {
634 dev_warn(&dev->dev, "refusing to load the driver as the " 647 dev_warn(&dev->dev, "refusing to load the driver as the "
@@ -639,7 +652,7 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev,
639 dev_info(&dev->dev, "Cirrus PD6729 PCI to PCMCIA Bridge at 0x%llx " 652 dev_info(&dev->dev, "Cirrus PD6729 PCI to PCMCIA Bridge at 0x%llx "
640 "on irq %d\n", 653 "on irq %d\n",
641 (unsigned long long)pci_resource_start(dev, 0), dev->irq); 654 (unsigned long long)pci_resource_start(dev, 0), dev->irq);
642 /* 655 /*
643 * Since we have no memory BARs some firmware may not 656 * Since we have no memory BARs some firmware may not
644 * have had PCI_COMMAND_MEMORY enabled, yet the device needs it. 657 * have had PCI_COMMAND_MEMORY enabled, yet the device needs it.
645 */ 658 */
@@ -685,8 +698,9 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev,
685 pci_set_drvdata(dev, socket); 698 pci_set_drvdata(dev, socket);
686 if (irq_mode == 1) { 699 if (irq_mode == 1) {
687 /* Register the interrupt handler */ 700 /* Register the interrupt handler */
688 if ((ret = request_irq(dev->irq, pd6729_interrupt, IRQF_SHARED, 701 ret = request_irq(dev->irq, pd6729_interrupt, IRQF_SHARED,
689 "pd6729", socket))) { 702 "pd6729", socket);
703 if (ret) {
690 dev_err(&dev->dev, "Failed to register irq %d\n", 704 dev_err(&dev->dev, "Failed to register irq %d\n",
691 dev->irq); 705 dev->irq);
692 goto err_out_free_res; 706 goto err_out_free_res;
@@ -750,18 +764,6 @@ static void __devexit pd6729_pci_remove(struct pci_dev *dev)
750 kfree(socket); 764 kfree(socket);
751} 765}
752 766
753#ifdef CONFIG_PM
754static int pd6729_socket_suspend(struct pci_dev *dev, pm_message_t state)
755{
756 return pcmcia_socket_dev_suspend(&dev->dev);
757}
758
759static int pd6729_socket_resume(struct pci_dev *dev)
760{
761 return pcmcia_socket_dev_resume(&dev->dev);
762}
763#endif
764
765static struct pci_device_id pd6729_pci_ids[] = { 767static struct pci_device_id pd6729_pci_ids[] = {
766 { 768 {
767 .vendor = PCI_VENDOR_ID_CIRRUS, 769 .vendor = PCI_VENDOR_ID_CIRRUS,
@@ -778,10 +780,6 @@ static struct pci_driver pd6729_pci_driver = {
778 .id_table = pd6729_pci_ids, 780 .id_table = pd6729_pci_ids,
779 .probe = pd6729_pci_probe, 781 .probe = pd6729_pci_probe,
780 .remove = __devexit_p(pd6729_pci_remove), 782 .remove = __devexit_p(pd6729_pci_remove),
781#ifdef CONFIG_PM
782 .suspend = pd6729_socket_suspend,
783 .resume = pd6729_socket_resume,
784#endif
785}; 783};
786 784
787static int pd6729_module_init(void) 785static int pd6729_module_init(void)
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index 76e640bccde8..0a876fabfe44 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -325,19 +325,13 @@ static int pxa2xx_drv_pcmcia_remove(struct platform_device *dev)
325 return 0; 325 return 0;
326} 326}
327 327
328static int pxa2xx_drv_pcmcia_suspend(struct device *dev)
329{
330 return pcmcia_socket_dev_suspend(dev);
331}
332
333static int pxa2xx_drv_pcmcia_resume(struct device *dev) 328static int pxa2xx_drv_pcmcia_resume(struct device *dev)
334{ 329{
335 pxa2xx_configure_sockets(dev); 330 pxa2xx_configure_sockets(dev);
336 return pcmcia_socket_dev_resume(dev); 331 return 0;
337} 332}
338 333
339static const struct dev_pm_ops pxa2xx_drv_pcmcia_pm_ops = { 334static const struct dev_pm_ops pxa2xx_drv_pcmcia_pm_ops = {
340 .suspend = pxa2xx_drv_pcmcia_suspend,
341 .resume = pxa2xx_drv_pcmcia_resume, 335 .resume = pxa2xx_drv_pcmcia_resume,
342}; 336};
343 337
diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index 4663b3fa9f96..dcc602134d90 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -810,6 +810,13 @@ static int adjust_io(struct pcmcia_socket *s, unsigned int action, unsigned long
810 unsigned long size = end - start + 1; 810 unsigned long size = end - start + 1;
811 int ret = 0; 811 int ret = 0;
812 812
813#if defined(CONFIG_X86)
814 /* on x86, avoid anything < 0x100 for it is often used for
815 * legacy platform devices */
816 if (start < 0x100)
817 start = 0x100;
818#endif
819
813 if (end < start) 820 if (end < start)
814 return -EINVAL; 821 return -EINVAL;
815 822
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c
index 8db86b90c200..518896241429 100644
--- a/drivers/pcmcia/sa1100_generic.c
+++ b/drivers/pcmcia/sa1100_generic.c
@@ -95,17 +95,6 @@ static int sa11x0_drv_pcmcia_remove(struct platform_device *dev)
95 return 0; 95 return 0;
96} 96}
97 97
98static int sa11x0_drv_pcmcia_suspend(struct platform_device *dev,
99 pm_message_t state)
100{
101 return pcmcia_socket_dev_suspend(&dev->dev);
102}
103
104static int sa11x0_drv_pcmcia_resume(struct platform_device *dev)
105{
106 return pcmcia_socket_dev_resume(&dev->dev);
107}
108
109static struct platform_driver sa11x0_pcmcia_driver = { 98static struct platform_driver sa11x0_pcmcia_driver = {
110 .driver = { 99 .driver = {
111 .name = "sa11x0-pcmcia", 100 .name = "sa11x0-pcmcia",
@@ -113,8 +102,6 @@ static struct platform_driver sa11x0_pcmcia_driver = {
113 }, 102 },
114 .probe = sa11x0_drv_pcmcia_probe, 103 .probe = sa11x0_drv_pcmcia_probe,
115 .remove = sa11x0_drv_pcmcia_remove, 104 .remove = sa11x0_drv_pcmcia_remove,
116 .suspend = sa11x0_drv_pcmcia_suspend,
117 .resume = sa11x0_drv_pcmcia_resume,
118}; 105};
119 106
120/* sa11x0_pcmcia_init() 107/* sa11x0_pcmcia_init()
diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c
index db79ca61cf96..799e9793e49e 100644
--- a/drivers/pcmcia/sa1111_generic.c
+++ b/drivers/pcmcia/sa1111_generic.c
@@ -213,16 +213,6 @@ static int __devexit pcmcia_remove(struct sa1111_dev *dev)
213 return 0; 213 return 0;
214} 214}
215 215
216static int pcmcia_suspend(struct sa1111_dev *dev, pm_message_t state)
217{
218 return pcmcia_socket_dev_suspend(&dev->dev);
219}
220
221static int pcmcia_resume(struct sa1111_dev *dev)
222{
223 return pcmcia_socket_dev_resume(&dev->dev);
224}
225
226static struct sa1111_driver pcmcia_driver = { 216static struct sa1111_driver pcmcia_driver = {
227 .drv = { 217 .drv = {
228 .name = "sa1111-pcmcia", 218 .name = "sa1111-pcmcia",
@@ -230,8 +220,6 @@ static struct sa1111_driver pcmcia_driver = {
230 .devid = SA1111_DEVID_PCMCIA, 220 .devid = SA1111_DEVID_PCMCIA,
231 .probe = pcmcia_probe, 221 .probe = pcmcia_probe,
232 .remove = __devexit_p(pcmcia_remove), 222 .remove = __devexit_p(pcmcia_remove),
233 .suspend = pcmcia_suspend,
234 .resume = pcmcia_resume,
235}; 223};
236 224
237static int __init sa1111_drv_pcmcia_init(void) 225static int __init sa1111_drv_pcmcia_init(void)
diff --git a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c
index 12c49ee135e1..bac85f3236bb 100644
--- a/drivers/pcmcia/tcic.c
+++ b/drivers/pcmcia/tcic.c
@@ -348,16 +348,6 @@ static int __init get_tcic_id(void)
348 return id; 348 return id;
349} 349}
350 350
351static int tcic_drv_pcmcia_suspend(struct platform_device *dev,
352 pm_message_t state)
353{
354 return pcmcia_socket_dev_suspend(&dev->dev);
355}
356
357static int tcic_drv_pcmcia_resume(struct platform_device *dev)
358{
359 return pcmcia_socket_dev_resume(&dev->dev);
360}
361/*====================================================================*/ 351/*====================================================================*/
362 352
363static struct platform_driver tcic_driver = { 353static struct platform_driver tcic_driver = {
@@ -365,8 +355,6 @@ static struct platform_driver tcic_driver = {
365 .name = "tcic-pcmcia", 355 .name = "tcic-pcmcia",
366 .owner = THIS_MODULE, 356 .owner = THIS_MODULE,
367 }, 357 },
368 .suspend = tcic_drv_pcmcia_suspend,
369 .resume = tcic_drv_pcmcia_resume,
370}; 358};
371 359
372static struct platform_device tcic_device = { 360static struct platform_device tcic_device = {
diff --git a/drivers/pcmcia/vrc4171_card.c b/drivers/pcmcia/vrc4171_card.c
index aaccdb9f4ba1..86e4a1a3c642 100644
--- a/drivers/pcmcia/vrc4171_card.c
+++ b/drivers/pcmcia/vrc4171_card.c
@@ -705,24 +705,11 @@ static int __devinit vrc4171_card_setup(char *options)
705 705
706__setup("vrc4171_card=", vrc4171_card_setup); 706__setup("vrc4171_card=", vrc4171_card_setup);
707 707
708static int vrc4171_card_suspend(struct platform_device *dev,
709 pm_message_t state)
710{
711 return pcmcia_socket_dev_suspend(&dev->dev);
712}
713
714static int vrc4171_card_resume(struct platform_device *dev)
715{
716 return pcmcia_socket_dev_resume(&dev->dev);
717}
718
719static struct platform_driver vrc4171_card_driver = { 708static struct platform_driver vrc4171_card_driver = {
720 .driver = { 709 .driver = {
721 .name = vrc4171_card_name, 710 .name = vrc4171_card_name,
722 .owner = THIS_MODULE, 711 .owner = THIS_MODULE,
723 }, 712 },
724 .suspend = vrc4171_card_suspend,
725 .resume = vrc4171_card_resume,
726}; 713};
727 714
728static int __devinit vrc4171_card_init(void) 715static int __devinit vrc4171_card_init(void)
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 418988ab6edf..f19ad02374d9 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -1290,12 +1290,9 @@ static int yenta_dev_suspend_noirq(struct device *dev)
1290{ 1290{
1291 struct pci_dev *pdev = to_pci_dev(dev); 1291 struct pci_dev *pdev = to_pci_dev(dev);
1292 struct yenta_socket *socket = pci_get_drvdata(pdev); 1292 struct yenta_socket *socket = pci_get_drvdata(pdev);
1293 int ret;
1294
1295 ret = pcmcia_socket_dev_suspend(dev);
1296 1293
1297 if (!socket) 1294 if (!socket)
1298 return ret; 1295 return 0;
1299 1296
1300 if (socket->type && socket->type->save_state) 1297 if (socket->type && socket->type->save_state)
1301 socket->type->save_state(socket); 1298 socket->type->save_state(socket);
@@ -1312,7 +1309,7 @@ static int yenta_dev_suspend_noirq(struct device *dev)
1312 */ 1309 */
1313 /* pci_set_power_state(dev, 3); */ 1310 /* pci_set_power_state(dev, 3); */
1314 1311
1315 return ret; 1312 return 0;
1316} 1313}
1317 1314
1318static int yenta_dev_resume_noirq(struct device *dev) 1315static int yenta_dev_resume_noirq(struct device *dev)
@@ -1336,26 +1333,16 @@ static int yenta_dev_resume_noirq(struct device *dev)
1336 if (socket->type && socket->type->restore_state) 1333 if (socket->type && socket->type->restore_state)
1337 socket->type->restore_state(socket); 1334 socket->type->restore_state(socket);
1338 1335
1339 pcmcia_socket_dev_early_resume(dev);
1340 return 0;
1341}
1342
1343static int yenta_dev_resume(struct device *dev)
1344{
1345 pcmcia_socket_dev_late_resume(dev);
1346 return 0; 1336 return 0;
1347} 1337}
1348 1338
1349static const struct dev_pm_ops yenta_pm_ops = { 1339static const struct dev_pm_ops yenta_pm_ops = {
1350 .suspend_noirq = yenta_dev_suspend_noirq, 1340 .suspend_noirq = yenta_dev_suspend_noirq,
1351 .resume_noirq = yenta_dev_resume_noirq, 1341 .resume_noirq = yenta_dev_resume_noirq,
1352 .resume = yenta_dev_resume,
1353 .freeze_noirq = yenta_dev_suspend_noirq, 1342 .freeze_noirq = yenta_dev_suspend_noirq,
1354 .thaw_noirq = yenta_dev_resume_noirq, 1343 .thaw_noirq = yenta_dev_resume_noirq,
1355 .thaw = yenta_dev_resume,
1356 .poweroff_noirq = yenta_dev_suspend_noirq, 1344 .poweroff_noirq = yenta_dev_suspend_noirq,
1357 .restore_noirq = yenta_dev_resume_noirq, 1345 .restore_noirq = yenta_dev_resume_noirq,
1358 .restore = yenta_dev_resume,
1359}; 1346};
1360 1347
1361#define YENTA_PM_OPS (&yenta_pm_ops) 1348#define YENTA_PM_OPS (&yenta_pm_ops)
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index 32896a773910..2e488b60bc76 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -277,12 +277,6 @@ extern struct pccard_resource_ops pccard_nonstatic_ops;
277#endif 277#endif
278 278
279 279
280/* socket drivers are expected to use these callbacks in their .drv struct */
281extern int pcmcia_socket_dev_suspend(struct device *dev);
282extern void pcmcia_socket_dev_early_resume(struct device *dev);
283extern void pcmcia_socket_dev_late_resume(struct device *dev);
284extern int pcmcia_socket_dev_resume(struct device *dev);
285
286/* socket drivers use this callback in their IRQ handler */ 280/* socket drivers use this callback in their IRQ handler */
287extern void pcmcia_parse_events(struct pcmcia_socket *socket, 281extern void pcmcia_parse_events(struct pcmcia_socket *socket,
288 unsigned int events); 282 unsigned int events);