pcmcia: use dev_pm_ops for class pcmcia_socket_class
authorDominik Brodowski <linux@dominikbrodowski.net>
Mon, 15 Mar 2010 20:46:34 +0000 (21:46 +0100)
committerDominik Brodowski <linux@dominikbrodowski.net>
Wed, 24 Mar 2010 10:00:11 +0000 (11:00 +0100)
Instead of requiring PCMCIA socket drivers to call various functions
during their (bus) resume and suspend functions, register an own
dev_pm_ops for this class. This fixes several suspend/resume bugs
seen on db1xxx-ss, and probably on some other socket drivers, too.

With regard to the asymmetry with only _noirq suspend, but split up
resume, please see bug 14334 and commit 9905d1b411946fb3 .

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
19 files changed:
drivers/pcmcia/at91_cf.c
drivers/pcmcia/au1000_generic.c
drivers/pcmcia/bfin_cf_pcmcia.c
drivers/pcmcia/cs.c
drivers/pcmcia/db1xxx_ss.c
drivers/pcmcia/i82092.c
drivers/pcmcia/i82365.c
drivers/pcmcia/m32r_cfc.c
drivers/pcmcia/m32r_pcc.c
drivers/pcmcia/m8xx_pcmcia.c
drivers/pcmcia/omap_cf.c
drivers/pcmcia/pd6729.c
drivers/pcmcia/pxa2xx_base.c
drivers/pcmcia/sa1100_generic.c
drivers/pcmcia/sa1111_generic.c
drivers/pcmcia/tcic.c
drivers/pcmcia/vrc4171_card.c
drivers/pcmcia/yenta_socket.c
include/pcmcia/ss.h

index 5d228071ec69b938fb860ef51470c3adc3ea8025..fb904f444d900563601fd073199b6bb1a4cf65c8 100644 (file)
@@ -361,7 +361,6 @@ static int at91_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
        struct at91_cf_socket   *cf = platform_get_drvdata(pdev);
        struct at91_cf_data     *board = cf->board;
 
-       pcmcia_socket_dev_suspend(&pdev->dev);
        if (device_may_wakeup(&pdev->dev)) {
                enable_irq_wake(board->det_pin);
                if (board->irq_pin)
@@ -381,7 +380,6 @@ static int at91_cf_resume(struct platform_device *pdev)
                        disable_irq_wake(board->irq_pin);
        }
 
-       pcmcia_socket_dev_resume(&pdev->dev);
        return 0;
 }
 
index 171c8a654887a65dcb91663e1173d48242923653..ac4d089430fd1476e88a6636ea9e763255896b25 100644 (file)
@@ -510,17 +510,6 @@ static int au1x00_drv_pcmcia_probe(struct platform_device *dev)
        return ret;
 }
 
-static int au1x00_drv_pcmcia_suspend(struct platform_device *dev,
-                                    pm_message_t state)
-{
-       return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int au1x00_drv_pcmcia_resume(struct platform_device *dev)
-{
-       return pcmcia_socket_dev_resume(&dev->dev);
-}
-
 static struct platform_driver au1x00_pcmcia_driver = {
        .driver = {
                .name           = "au1x00-pcmcia",
@@ -528,8 +517,6 @@ static struct platform_driver au1x00_pcmcia_driver = {
        },
        .probe          = au1x00_drv_pcmcia_probe,
        .remove         = au1x00_drv_pcmcia_remove,
-       .suspend        = au1x00_drv_pcmcia_suspend,
-       .resume         = au1x00_drv_pcmcia_resume,
 };
 
 
index 2482ce7ac6dcb3f9845eeebe664ab30defeb76b8..93f9ddeb0c36d1519762a4e55289f98d84bbca78 100644 (file)
@@ -300,16 +300,6 @@ static int __devexit bfin_cf_remove(struct platform_device *pdev)
        return 0;
 }
 
-static int bfin_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
-{
-       return pcmcia_socket_dev_suspend(&pdev->dev);
-}
-
-static int bfin_cf_resume(struct platform_device *pdev)
-{
-       return pcmcia_socket_dev_resume(&pdev->dev);
-}
-
 static struct platform_driver bfin_cf_driver = {
        .driver = {
                   .name = (char *)driver_name,
@@ -317,8 +307,6 @@ static struct platform_driver bfin_cf_driver = {
                   },
        .probe = bfin_cf_probe,
        .remove = __devexit_p(bfin_cf_remove),
-       .suspend = bfin_cf_suspend,
-       .resume = bfin_cf_resume,
 };
 
 static int __init bfin_cf_init(void)
index e679e708db630e3c8a93a7f6d87ded908a2c397e..75ed866e6953944c871dd46bfc94f4a54da997bd 100644 (file)
@@ -76,65 +76,6 @@ DECLARE_RWSEM(pcmcia_socket_list_rwsem);
 EXPORT_SYMBOL(pcmcia_socket_list_rwsem);
 
 
-/*
- * Low-level PCMCIA socket drivers need to register with the PCCard
- * core using pcmcia_register_socket.
- *
- * socket drivers are expected to use the following callbacks in their
- * .drv struct:
- *  - pcmcia_socket_dev_suspend
- *  - pcmcia_socket_dev_resume
- * These functions check for the appropriate struct pcmcia_soket arrays,
- * and pass them to the low-level functions pcmcia_{suspend,resume}_socket
- */
-static int socket_early_resume(struct pcmcia_socket *skt);
-static int socket_late_resume(struct pcmcia_socket *skt);
-static int socket_resume(struct pcmcia_socket *skt);
-static int socket_suspend(struct pcmcia_socket *skt);
-
-static void pcmcia_socket_dev_run(struct device *dev,
-                                 int (*cb)(struct pcmcia_socket *))
-{
-       struct pcmcia_socket *socket;
-
-       down_read(&pcmcia_socket_list_rwsem);
-       list_for_each_entry(socket, &pcmcia_socket_list, socket_list) {
-               if (socket->dev.parent != dev)
-                       continue;
-               mutex_lock(&socket->skt_mutex);
-               cb(socket);
-               mutex_unlock(&socket->skt_mutex);
-       }
-       up_read(&pcmcia_socket_list_rwsem);
-}
-
-int pcmcia_socket_dev_suspend(struct device *dev)
-{
-       pcmcia_socket_dev_run(dev, socket_suspend);
-       return 0;
-}
-EXPORT_SYMBOL(pcmcia_socket_dev_suspend);
-
-void pcmcia_socket_dev_early_resume(struct device *dev)
-{
-       pcmcia_socket_dev_run(dev, socket_early_resume);
-}
-EXPORT_SYMBOL(pcmcia_socket_dev_early_resume);
-
-void pcmcia_socket_dev_late_resume(struct device *dev)
-{
-       pcmcia_socket_dev_run(dev, socket_late_resume);
-}
-EXPORT_SYMBOL(pcmcia_socket_dev_late_resume);
-
-int pcmcia_socket_dev_resume(struct device *dev)
-{
-       pcmcia_socket_dev_run(dev, socket_resume);
-       return 0;
-}
-EXPORT_SYMBOL(pcmcia_socket_dev_resume);
-
-
 struct pcmcia_socket *pcmcia_get_socket(struct pcmcia_socket *skt)
 {
        struct device *dev = get_device(&skt->dev);
@@ -578,12 +519,18 @@ static int socket_early_resume(struct pcmcia_socket *skt)
 
 static int socket_late_resume(struct pcmcia_socket *skt)
 {
+       int ret;
+
        mutex_lock(&skt->ops_mutex);
        skt->state &= ~SOCKET_SUSPEND;
        mutex_unlock(&skt->ops_mutex);
 
-       if (!(skt->state & SOCKET_PRESENT))
-               return socket_insert(skt);
+       if (!(skt->state & SOCKET_PRESENT)) {
+               ret = socket_insert(skt);
+               if (ret == -ENODEV)
+                       ret = 0;
+               return ret;
+       }
 
        if (skt->resume_status) {
                socket_shutdown(skt);
@@ -919,11 +866,66 @@ static void pcmcia_release_socket_class(struct class *data)
 }
 
 
+#ifdef CONFIG_PM
+
+static int __pcmcia_pm_op(struct device *dev,
+                         int (*callback) (struct pcmcia_socket *skt))
+{
+       struct pcmcia_socket *s = container_of(dev, struct pcmcia_socket, dev);
+       int ret;
+
+       mutex_lock(&s->skt_mutex);
+       ret = callback(s);
+       mutex_unlock(&s->skt_mutex);
+
+       return ret;
+}
+
+static int pcmcia_socket_dev_suspend_noirq(struct device *dev)
+{
+       return __pcmcia_pm_op(dev, socket_suspend);
+}
+
+static int pcmcia_socket_dev_resume_noirq(struct device *dev)
+{
+       return __pcmcia_pm_op(dev, socket_early_resume);
+}
+
+static int pcmcia_socket_dev_resume(struct device *dev)
+{
+       return __pcmcia_pm_op(dev, socket_late_resume);
+}
+
+static const struct dev_pm_ops pcmcia_socket_pm_ops = {
+       /* dev_resume may be called with IRQs enabled */
+       SET_SYSTEM_SLEEP_PM_OPS(NULL,
+                               pcmcia_socket_dev_resume)
+
+       /* late suspend must be called with IRQs disabled */
+       .suspend_noirq = pcmcia_socket_dev_suspend_noirq,
+       .freeze_noirq = pcmcia_socket_dev_suspend_noirq,
+       .poweroff_noirq = pcmcia_socket_dev_suspend_noirq,
+
+       /* early resume must be called with IRQs disabled */
+       .resume_noirq = pcmcia_socket_dev_resume_noirq,
+       .thaw_noirq = pcmcia_socket_dev_resume_noirq,
+       .restore_noirq = pcmcia_socket_dev_resume_noirq,
+};
+
+#define PCMCIA_SOCKET_CLASS_PM_OPS (&pcmcia_socket_pm_ops)
+
+#else /* CONFIG_PM */
+
+#define PCMCIA_SOCKET_CLASS_PM_OPS NULL
+
+#endif /* CONFIG_PM */
+
 struct class pcmcia_socket_class = {
        .name = "pcmcia_socket",
        .dev_uevent = pcmcia_socket_uevent,
        .dev_release = pcmcia_release_socket,
        .class_release = pcmcia_release_socket_class,
+       .pm = PCMCIA_SOCKET_CLASS_PM_OPS,
 };
 EXPORT_SYMBOL(pcmcia_socket_class);
 
index 9254ab0b29b1b1262fdc1fdb9b1c705041128ae7..a520193b645393ef60f4cf01861533bd987a2522 100644 (file)
@@ -558,37 +558,10 @@ static int __devexit db1x_pcmcia_socket_remove(struct platform_device *pdev)
        return 0;
 }
 
-#ifdef CONFIG_PM
-static int db1x_pcmcia_suspend(struct device *dev)
-{
-       return pcmcia_socket_dev_suspend(dev);
-}
-
-static int db1x_pcmcia_resume(struct device *dev)
-{
-       return pcmcia_socket_dev_resume(dev);
-}
-
-static struct dev_pm_ops db1x_pcmcia_pmops = {
-       .resume         = db1x_pcmcia_resume,
-       .suspend        = db1x_pcmcia_suspend,
-       .thaw           = db1x_pcmcia_resume,
-       .freeze         = db1x_pcmcia_suspend,
-};
-
-#define DB1XXX_SS_PMOPS &db1x_pcmcia_pmops
-
-#else
-
-#define DB1XXX_SS_PMOPS NULL
-
-#endif
-
 static struct platform_driver db1x_pcmcia_socket_driver = {
        .driver = {
                .name   = "db1xxx_pcmcia",
                .owner  = THIS_MODULE,
-               .pm     = DB1XXX_SS_PMOPS
        },
        .probe          = db1x_pcmcia_socket_probe,
        .remove         = __devexit_p(db1x_pcmcia_socket_remove),
index f5da6265331331a5209f9a938d32b1d3989f430f..3003bb3dfcc0d08912897b2192e732ea26cccbf3 100644 (file)
@@ -39,27 +39,11 @@ static struct pci_device_id i82092aa_pci_ids[] = {
 };
 MODULE_DEVICE_TABLE(pci, i82092aa_pci_ids);
 
-#ifdef CONFIG_PM
-static int i82092aa_socket_suspend (struct pci_dev *dev, pm_message_t state)
-{
-       return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int i82092aa_socket_resume (struct pci_dev *dev)
-{
-       return pcmcia_socket_dev_resume(&dev->dev);
-}
-#endif
-
 static struct pci_driver i82092aa_pci_driver = {
        .name           = "i82092aa",
        .id_table       = i82092aa_pci_ids,
        .probe          = i82092aa_pci_probe,
        .remove         = __devexit_p(i82092aa_pci_remove),
-#ifdef CONFIG_PM
-       .suspend        = i82092aa_socket_suspend,
-       .resume         = i82092aa_socket_resume,
-#endif
 };
 
 
index c13fd9360511b89fe3b52f37477bb86a6dab5f1a..d53d9b5659c71ba960345b5453975753de154210 100644 (file)
@@ -1223,16 +1223,7 @@ static int pcic_init(struct pcmcia_socket *s)
        return 0;
 }
 
-static int i82365_drv_pcmcia_suspend(struct platform_device *dev,
-                                    pm_message_t state)
-{
-       return pcmcia_socket_dev_suspend(&dev->dev);
-}
 
-static int i82365_drv_pcmcia_resume(struct platform_device *dev)
-{
-       return pcmcia_socket_dev_resume(&dev->dev);
-}
 static struct pccard_operations pcic_operations = {
        .init                   = pcic_init,
        .get_status             = pcic_get_status,
@@ -1248,8 +1239,6 @@ static struct platform_driver i82365_driver = {
                .name = "i82365",
                .owner          = THIS_MODULE,
        },
-       .suspend        = i82365_drv_pcmcia_suspend,
-       .resume         = i82365_drv_pcmcia_resume,
 };
 
 static struct platform_device *i82365_device;
index 0ece2cd4a85ea9640bd408fe0dc55ebe65a5692e..ab21264468d6e5f6764c06dada7f9f3face9d3da 100644 (file)
@@ -685,16 +685,7 @@ static struct pccard_operations pcc_operations = {
        .set_mem_map            = pcc_set_mem_map,
 };
 
-static int cfc_drv_pcmcia_suspend(struct platform_device *dev,
-                                    pm_message_t state)
-{
-       return pcmcia_socket_dev_suspend(&dev->dev);
-}
 
-static int cfc_drv_pcmcia_resume(struct platform_device *dev)
-{
-       return pcmcia_socket_dev_resume(&dev->dev);
-}
 /*====================================================================*/
 
 static struct platform_driver pcc_driver = {
@@ -702,8 +693,6 @@ static struct platform_driver pcc_driver = {
                .name           = "cfc",
                .owner          = THIS_MODULE,
        },
-       .suspend        = cfc_drv_pcmcia_suspend,
-       .resume         = cfc_drv_pcmcia_resume,
 };
 
 static struct platform_device pcc_device = {
index 72844c5a6d05fb53999ded835e5bf56f22ba6a21..0caf3db7c70012ff2edc0fe3d41586474fe09546 100644 (file)
@@ -663,16 +663,6 @@ static struct pccard_operations pcc_operations = {
        .set_mem_map            = pcc_set_mem_map,
 };
 
-static int pcc_drv_pcmcia_suspend(struct platform_device *dev,
-                                    pm_message_t state)
-{
-       return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int pcc_drv_pcmcia_resume(struct platform_device *dev)
-{
-       return pcmcia_socket_dev_resume(&dev->dev);
-}
 /*====================================================================*/
 
 static struct platform_driver pcc_driver = {
@@ -680,8 +670,6 @@ static struct platform_driver pcc_driver = {
                .name           = "pcc",
                .owner          = THIS_MODULE,
        },
-       .suspend        = pcc_drv_pcmcia_suspend,
-       .resume         = pcc_drv_pcmcia_resume,
 };
 
 static struct platform_device pcc_device = {
index 61c2159181288e5442381696b1eb60e2eaed8994..01ef7de15322bf9668edb16aea84006b0ea7b43e 100644 (file)
@@ -1288,21 +1288,6 @@ static int m8xx_remove(struct of_device *ofdev)
        return 0;
 }
 
-#ifdef CONFIG_PM
-static int m8xx_suspend(struct platform_device *pdev, pm_message_t state)
-{
-       return pcmcia_socket_dev_suspend(&pdev->dev);
-}
-
-static int m8xx_resume(struct platform_device *pdev)
-{
-       return pcmcia_socket_dev_resume(&pdev->dev);
-}
-#else
-#define m8xx_suspend NULL
-#define m8xx_resume NULL
-#endif
-
 static const struct of_device_id m8xx_pcmcia_match[] = {
        {
         .type = "pcmcia",
@@ -1318,8 +1303,6 @@ static struct of_platform_driver m8xx_pcmcia_driver = {
        .match_table = m8xx_pcmcia_match,
        .probe = m8xx_probe,
        .remove = m8xx_remove,
-       .suspend = m8xx_suspend,
-       .resume = m8xx_resume,
 };
 
 static int __init m8xx_init(void)
index 3ef991552398095ddc9de8b7f2505be88108437f..9edc396577b9ecaf25b403bda90f7a603a242a05 100644 (file)
@@ -330,24 +330,12 @@ static int __exit omap_cf_remove(struct platform_device *pdev)
        return 0;
 }
 
-static int omap_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
-{
-       return pcmcia_socket_dev_suspend(&pdev->dev);
-}
-
-static int omap_cf_resume(struct platform_device *pdev)
-{
-       return pcmcia_socket_dev_resume(&pdev->dev);
-}
-
 static struct platform_driver omap_cf_driver = {
        .driver = {
                .name   = (char *) driver_name,
                .owner  = THIS_MODULE,
        },
        .remove         = __exit_p(omap_cf_remove),
-       .suspend        = omap_cf_suspend,
-       .resume         = omap_cf_resume,
 };
 
 static int __init omap_cf_init(void)
index 47f342f1b0fced47746b1f8a8f2fd699a258168c..4a34268cc512a306cae7bae0159634673a494c5a 100644 (file)
@@ -764,18 +764,6 @@ static void __devexit pd6729_pci_remove(struct pci_dev *dev)
        kfree(socket);
 }
 
-#ifdef CONFIG_PM
-static int pd6729_socket_suspend(struct pci_dev *dev, pm_message_t state)
-{
-       return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int pd6729_socket_resume(struct pci_dev *dev)
-{
-       return pcmcia_socket_dev_resume(&dev->dev);
-}
-#endif
-
 static struct pci_device_id pd6729_pci_ids[] = {
        {
                .vendor         = PCI_VENDOR_ID_CIRRUS,
@@ -792,10 +780,6 @@ static struct pci_driver pd6729_pci_driver = {
        .id_table       = pd6729_pci_ids,
        .probe          = pd6729_pci_probe,
        .remove         = __devexit_p(pd6729_pci_remove),
-#ifdef CONFIG_PM
-       .suspend        = pd6729_socket_suspend,
-       .resume         = pd6729_socket_resume,
-#endif
 };
 
 static int pd6729_module_init(void)
index 76e640bccde848c258799b2d4b245e73a17e37bb..0a876fabfe44f1596b7109310fea5934d3567c90 100644 (file)
@@ -325,19 +325,13 @@ static int pxa2xx_drv_pcmcia_remove(struct platform_device *dev)
        return 0;
 }
 
-static int pxa2xx_drv_pcmcia_suspend(struct device *dev)
-{
-       return pcmcia_socket_dev_suspend(dev);
-}
-
 static int pxa2xx_drv_pcmcia_resume(struct device *dev)
 {
        pxa2xx_configure_sockets(dev);
-       return pcmcia_socket_dev_resume(dev);
+       return 0;
 }
 
 static const struct dev_pm_ops pxa2xx_drv_pcmcia_pm_ops = {
-       .suspend        = pxa2xx_drv_pcmcia_suspend,
        .resume         = pxa2xx_drv_pcmcia_resume,
 };
 
index 8db86b90c200e089a59dc5ea0fd17e721e490411..518896241429336b878db5a54099780ab84239ea 100644 (file)
@@ -95,17 +95,6 @@ static int sa11x0_drv_pcmcia_remove(struct platform_device *dev)
        return 0;
 }
 
-static int sa11x0_drv_pcmcia_suspend(struct platform_device *dev,
-                                    pm_message_t state)
-{
-       return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int sa11x0_drv_pcmcia_resume(struct platform_device *dev)
-{
-       return pcmcia_socket_dev_resume(&dev->dev);
-}
-
 static struct platform_driver sa11x0_pcmcia_driver = {
        .driver = {
                .name           = "sa11x0-pcmcia",
@@ -113,8 +102,6 @@ static struct platform_driver sa11x0_pcmcia_driver = {
        },
        .probe          = sa11x0_drv_pcmcia_probe,
        .remove         = sa11x0_drv_pcmcia_remove,
-       .suspend        = sa11x0_drv_pcmcia_suspend,
-       .resume         = sa11x0_drv_pcmcia_resume,
 };
 
 /* sa11x0_pcmcia_init()
index db79ca61cf964ec7ba51b71b2d41f7d97dd8e62b..799e9793e49ecb335695877b16668867d7194d18 100644 (file)
@@ -213,16 +213,6 @@ static int __devexit pcmcia_remove(struct sa1111_dev *dev)
        return 0;
 }
 
-static int pcmcia_suspend(struct sa1111_dev *dev, pm_message_t state)
-{
-       return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int pcmcia_resume(struct sa1111_dev *dev)
-{
-       return pcmcia_socket_dev_resume(&dev->dev);
-}
-
 static struct sa1111_driver pcmcia_driver = {
        .drv = {
                .name   = "sa1111-pcmcia",
@@ -230,8 +220,6 @@ static struct sa1111_driver pcmcia_driver = {
        .devid          = SA1111_DEVID_PCMCIA,
        .probe          = pcmcia_probe,
        .remove         = __devexit_p(pcmcia_remove),
-       .suspend        = pcmcia_suspend,
-       .resume         = pcmcia_resume,
 };
 
 static int __init sa1111_drv_pcmcia_init(void)
index 12c49ee135e1edb36ce47a17d06f3be9ee2fe822..bac85f3236bb428c17f72bcd32ac9cbf7fe894f8 100644 (file)
@@ -348,16 +348,6 @@ static int __init get_tcic_id(void)
     return id;
 }
 
-static int tcic_drv_pcmcia_suspend(struct platform_device *dev,
-                                    pm_message_t state)
-{
-       return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int tcic_drv_pcmcia_resume(struct platform_device *dev)
-{
-       return pcmcia_socket_dev_resume(&dev->dev);
-}
 /*====================================================================*/
 
 static struct platform_driver tcic_driver = {
@@ -365,8 +355,6 @@ static struct platform_driver tcic_driver = {
                .name = "tcic-pcmcia",
                .owner          = THIS_MODULE,
        },
-       .suspend        = tcic_drv_pcmcia_suspend,
-       .resume         = tcic_drv_pcmcia_resume,
 };
 
 static struct platform_device tcic_device = {
index aaccdb9f4ba170672a1de284769a03e4f361212d..86e4a1a3c6426d4524a79effd9310fa48c7bc2e3 100644 (file)
@@ -705,24 +705,11 @@ static int __devinit vrc4171_card_setup(char *options)
 
 __setup("vrc4171_card=", vrc4171_card_setup);
 
-static int vrc4171_card_suspend(struct platform_device *dev,
-                                    pm_message_t state)
-{
-       return pcmcia_socket_dev_suspend(&dev->dev);
-}
-
-static int vrc4171_card_resume(struct platform_device *dev)
-{
-       return pcmcia_socket_dev_resume(&dev->dev);
-}
-
 static struct platform_driver vrc4171_card_driver = {
        .driver = {
                .name           = vrc4171_card_name,
                .owner          = THIS_MODULE,
        },
-       .suspend        = vrc4171_card_suspend,
-       .resume         = vrc4171_card_resume,
 };
 
 static int __devinit vrc4171_card_init(void)
index 418988ab6edf336892675a39241aec7b9111910f..f19ad02374d97abe0f589c25e9c24e8f88e35a71 100644 (file)
@@ -1290,12 +1290,9 @@ static int yenta_dev_suspend_noirq(struct device *dev)
 {
        struct pci_dev *pdev = to_pci_dev(dev);
        struct yenta_socket *socket = pci_get_drvdata(pdev);
-       int ret;
-
-       ret = pcmcia_socket_dev_suspend(dev);
 
        if (!socket)
-               return ret;
+               return 0;
 
        if (socket->type && socket->type->save_state)
                socket->type->save_state(socket);
@@ -1312,7 +1309,7 @@ static int yenta_dev_suspend_noirq(struct device *dev)
         */
        /* pci_set_power_state(dev, 3); */
 
-       return ret;
+       return 0;
 }
 
 static int yenta_dev_resume_noirq(struct device *dev)
@@ -1336,26 +1333,16 @@ static int yenta_dev_resume_noirq(struct device *dev)
        if (socket->type && socket->type->restore_state)
                socket->type->restore_state(socket);
 
-       pcmcia_socket_dev_early_resume(dev);
-       return 0;
-}
-
-static int yenta_dev_resume(struct device *dev)
-{
-       pcmcia_socket_dev_late_resume(dev);
        return 0;
 }
 
 static const struct dev_pm_ops yenta_pm_ops = {
        .suspend_noirq = yenta_dev_suspend_noirq,
        .resume_noirq = yenta_dev_resume_noirq,
-       .resume = yenta_dev_resume,
        .freeze_noirq = yenta_dev_suspend_noirq,
        .thaw_noirq = yenta_dev_resume_noirq,
-       .thaw = yenta_dev_resume,
        .poweroff_noirq = yenta_dev_suspend_noirq,
        .restore_noirq = yenta_dev_resume_noirq,
-       .restore = yenta_dev_resume,
 };
 
 #define YENTA_PM_OPS   (&yenta_pm_ops)
index 32896a77391054babaeb60482ad121a4864329af..2e488b60bc7603668de714acc570e3c463db28d4 100644 (file)
@@ -277,12 +277,6 @@ extern struct pccard_resource_ops pccard_nonstatic_ops;
 #endif
 
 
-/* socket drivers are expected to use these callbacks in their .drv struct */
-extern int pcmcia_socket_dev_suspend(struct device *dev);
-extern void pcmcia_socket_dev_early_resume(struct device *dev);
-extern void pcmcia_socket_dev_late_resume(struct device *dev);
-extern int pcmcia_socket_dev_resume(struct device *dev);
-
 /* socket drivers use this callback in their IRQ handler */
 extern void pcmcia_parse_events(struct pcmcia_socket *socket,
                                unsigned int events);