]> err.no Git - linux-2.6/commitdiff
[PATCH] pcmcia: default suspend and resume handling
authorDominik Brodowski <linux@dominikbrodowski.net>
Wed, 1 Mar 2006 23:02:33 +0000 (00:02 +0100)
committerDominik Brodowski <linux@dominikbrodowski.net>
Fri, 31 Mar 2006 15:15:52 +0000 (17:15 +0200)
In all but one case, the suspend and resume functions of PCMCIA drivers
contain mostly of calls to pcmcia_release_configuration() and
pcmcia_request_configuration(). Therefore, move this code out of the
drivers and into the core.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
45 files changed:
drivers/bluetooth/bluecard_cs.c
drivers/bluetooth/bt3c_cs.c
drivers/bluetooth/btuart_cs.c
drivers/bluetooth/dtl1_cs.c
drivers/char/pcmcia/cm4000_cs.c
drivers/char/pcmcia/cm4040_cs.c
drivers/char/pcmcia/synclink_cs.c
drivers/ide/legacy/ide-cs.c
drivers/isdn/hardware/avm/avm_cs.c
drivers/isdn/hisax/avma1_cs.c
drivers/isdn/hisax/elsa_cs.c
drivers/isdn/hisax/sedlbauer_cs.c
drivers/isdn/hisax/teles_cs.c
drivers/net/pcmcia/3c574_cs.c
drivers/net/pcmcia/3c589_cs.c
drivers/net/pcmcia/axnet_cs.c
drivers/net/pcmcia/com20020_cs.c
drivers/net/pcmcia/fmvj18x_cs.c
drivers/net/pcmcia/ibmtr_cs.c
drivers/net/pcmcia/nmclan_cs.c
drivers/net/pcmcia/pcnet_cs.c
drivers/net/pcmcia/smc91c92_cs.c
drivers/net/pcmcia/xirc2ps_cs.c
drivers/net/wireless/airo_cs.c
drivers/net/wireless/atmel_cs.c
drivers/net/wireless/hostap/hostap_cs.c
drivers/net/wireless/netwave_cs.c
drivers/net/wireless/orinoco_cs.c
drivers/net/wireless/ray_cs.c
drivers/net/wireless/spectrum_cs.c
drivers/net/wireless/wavelan_cs.c
drivers/net/wireless/wl3501_cs.c
drivers/parport/parport_cs.c
drivers/pcmcia/ds.c
drivers/scsi/pcmcia/aha152x_stub.c
drivers/scsi/pcmcia/fdomain_stub.c
drivers/scsi/pcmcia/nsp_cs.c
drivers/scsi/pcmcia/qlogic_stub.c
drivers/scsi/pcmcia/sym53c500_cs.c
drivers/serial/serial_cs.c
drivers/telephony/ixj_pcmcia.c
drivers/usb/host/sl811_cs.c
include/pcmcia/ds.h
sound/pcmcia/pdaudiocf/pdaudiocf.c
sound/pcmcia/vx/vxpocket.c

index 128e41609a5dea3d8f3752f37d30fcb1ffc523d2..bb833b251b68a62df3451d0ae8a149ff57c059a6 100644 (file)
@@ -1005,28 +1005,6 @@ static void bluecard_release(dev_link_t *link)
        pcmcia_disable_device(link->handle);
 }
 
-static int bluecard_suspend(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
-
-       return 0;
-}
-
-static int bluecard_resume(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state &= ~DEV_SUSPEND;
-       if (DEV_OK(link))
-               pcmcia_request_configuration(link->handle, &link->conf);
-
-       return 0;
-}
-
 static struct pcmcia_device_id bluecard_ids[] = {
        PCMCIA_DEVICE_PROD_ID12("BlueCard", "LSE041", 0xbaf16fbf, 0x657cc15e),
        PCMCIA_DEVICE_PROD_ID12("BTCFCARD", "LSE139", 0xe3987764, 0x2524b59c),
@@ -1043,8 +1021,6 @@ static struct pcmcia_driver bluecard_driver = {
        .probe          = bluecard_attach,
        .remove         = bluecard_detach,
        .id_table       = bluecard_ids,
-       .suspend        = bluecard_suspend,
-       .resume         = bluecard_resume,
 };
 
 static int __init init_bluecard_cs(void)
index ac1410c0a43e2b37015967c0f843993f45233826..7b0f4f0beadaa91cb3286dd646d0d075941eb58f 100644 (file)
@@ -842,28 +842,6 @@ static void bt3c_release(dev_link_t *link)
        pcmcia_disable_device(link->handle);
 }
 
-static int bt3c_suspend(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
-
-       return 0;
-}
-
-static int bt3c_resume(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state &= ~DEV_SUSPEND;
-       if (DEV_OK(link))
-               pcmcia_request_configuration(link->handle, &link->conf);
-
-       return 0;
-}
-
 
 static struct pcmcia_device_id bt3c_ids[] = {
        PCMCIA_DEVICE_PROD_ID13("3COM", "Bluetooth PC Card", 0xefce0a31, 0xd4ce9b02),
@@ -879,8 +857,6 @@ static struct pcmcia_driver bt3c_driver = {
        .probe          = bt3c_attach,
        .remove         = bt3c_detach,
        .id_table       = bt3c_ids,
-       .suspend        = bt3c_suspend,
-       .resume         = bt3c_resume,
 };
 
 static int __init init_bt3c_cs(void)
index 8cd54bb199f95d369fecefb036c6275d4c535299..9a507bdb8bc6596fd984b4beee612d17fbda06fb 100644 (file)
@@ -771,29 +771,6 @@ static void btuart_release(dev_link_t *link)
        pcmcia_disable_device(link->handle);
 }
 
-static int btuart_suspend(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
-
-       return 0;
-}
-
-static int btuart_resume(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state &= ~DEV_SUSPEND;
-       if (DEV_OK(link))
-               pcmcia_request_configuration(link->handle, &link->conf);
-
-       return 0;
-}
-
-
 static struct pcmcia_device_id btuart_ids[] = {
        /* don't use this driver. Use serial_cs + hci_uart instead */
        PCMCIA_DEVICE_NULL
@@ -808,8 +785,6 @@ static struct pcmcia_driver btuart_driver = {
        .probe          = btuart_attach,
        .remove         = btuart_detach,
        .id_table       = btuart_ids,
-       .suspend        = btuart_suspend,
-       .resume         = btuart_resume,
 };
 
 static int __init init_btuart_cs(void)
index efbc8a543a9a1a1b2d08040cdaa6555fef20055a..39dbe7300d0fca78b4d491aebb0e6c7713bb4ddf 100644 (file)
@@ -723,28 +723,6 @@ static void dtl1_release(dev_link_t *link)
        pcmcia_disable_device(link->handle);
 }
 
-static int dtl1_suspend(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
-
-       return 0;
-}
-
-static int dtl1_resume(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state &= ~DEV_SUSPEND;
-       if (DEV_OK(link))
-               pcmcia_request_configuration(link->handle, &link->conf);
-
-       return 0;
-}
-
 
 static struct pcmcia_device_id dtl1_ids[] = {
        PCMCIA_DEVICE_PROD_ID12("Nokia Mobile Phones", "DTL-1", 0xe1bfdd64, 0xe168480d),
@@ -762,8 +740,6 @@ static struct pcmcia_driver dtl1_driver = {
        .probe          = dtl1_attach,
        .remove         = dtl1_detach,
        .id_table       = dtl1_ids,
-       .suspend        = dtl1_suspend,
-       .resume         = dtl1_resume,
 };
 
 static int __init init_dtl1_cs(void)
index 3ddd3da9e72001820ee4a9013950b51745235922..870decbdf7ca6702be18b78aad1bdd457e204c49 100644 (file)
@@ -1870,10 +1870,6 @@ static int cm4000_suspend(struct pcmcia_device *p_dev)
        struct cm4000_dev *dev;
 
        dev = link->priv;
-
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
        stop_monitor(dev);
 
        return 0;
@@ -1885,11 +1881,6 @@ static int cm4000_resume(struct pcmcia_device *p_dev)
        struct cm4000_dev *dev;
 
        dev = link->priv;
-
-       link->state &= ~DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_request_configuration(link->handle, &link->conf);
-
        if (link->open)
                start_monitor(dev);
 
index 1c355bd2be8803f86f78f956721869d5c14ea82e..47f10c8b888675da39780f38d0df65deda7e0b7c 100644 (file)
@@ -629,28 +629,6 @@ cs_release:
        link->state &= ~DEV_CONFIG_PENDING;
 }
 
-static int reader_suspend(struct pcmcia_device *p_dev)
-{
-       dev_link_t *link = dev_to_instance(p_dev);
-
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
-
-       return 0;
-}
-
-static int reader_resume(struct pcmcia_device *p_dev)
-{
-       dev_link_t *link = dev_to_instance(p_dev);
-
-       link->state &= ~DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_request_configuration(link->handle, &link->conf);
-
-       return 0;
-}
-
 static void reader_release(dev_link_t *link)
 {
        cm4040_reader_release(link->priv);
@@ -754,8 +732,6 @@ static struct pcmcia_driver reader_driver = {
        },
        .probe          = reader_attach,
        .remove         = reader_detach,
-       .suspend        = reader_suspend,
-       .resume         = reader_resume,
        .id_table       = cm4040_ids,
 };
 
index 371d10b78004eaa0bb77bd5ea42f04d6b5eb2d9a..d3ea53a5a50f41d9463fbc4f2473fd1b4385028c 100644 (file)
@@ -733,10 +733,7 @@ static int mgslpc_suspend(struct pcmcia_device *dev)
        dev_link_t *link = dev_to_instance(dev);
        MGSLPC_INFO *info = link->priv;
 
-       link->state |= DEV_SUSPEND;
        info->stop = 1;
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
 
        return 0;
 }
@@ -746,9 +743,6 @@ static int mgslpc_resume(struct pcmcia_device *dev)
        dev_link_t *link = dev_to_instance(dev);
        MGSLPC_INFO *info = link->priv;
 
-       link->state &= ~DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_request_configuration(link->handle, &link->conf);
        info->stop = 0;
 
        return 0;
index 024aad6164846e5cd8c277402d0888f66e3616cb..7ad8a95969fbd7cc6240f3392e8bbf5f0677f4c2 100644 (file)
@@ -373,27 +373,6 @@ void ide_release(dev_link_t *link)
     pcmcia_disable_device(link->handle);
 } /* ide_release */
 
-static int ide_suspend(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
-
-       return 0;
-}
-
-static int ide_resume(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state &= ~DEV_SUSPEND;
-       if (DEV_OK(link))
-               pcmcia_request_configuration(link->handle, &link->conf);
-
-       return 0;
-}
 
 /*======================================================================
 
@@ -456,8 +435,6 @@ static struct pcmcia_driver ide_cs_driver = {
        .probe          = ide_attach,
        .remove         = ide_detach,
        .id_table       = ide_ids,
-       .suspend        = ide_suspend,
-       .resume         = ide_resume,
 };
 
 static int __init init_ide_cs(void)
index 5f70661994d86e14387dc4c9b53cc0e1b2ece2c9..ae70247d51573929e455c0a7badfcbaa00c93fbe 100644 (file)
@@ -371,42 +371,6 @@ static void avmcs_release(dev_link_t *link)
        pcmcia_disable_device(link->handle);
 } /* avmcs_release */
 
-static int avmcs_suspend(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
-
-       return 0;
-}
-
-static int avmcs_resume(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state &= ~DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_request_configuration(link->handle, &link->conf);
-
-       return 0;
-}
-
-/*======================================================================
-
-    The card status event handler.  Mostly, this schedules other
-    stuff to run after an event is received.  A CARD_REMOVAL event
-    also sets some flags to discourage the net drivers from trying
-    to talk to the card any more.
-
-    When a CARD_REMOVAL event is received, we immediately set a flag
-    to block future accesses to this device.  All the functions that
-    actually access the device should check this flag to make sure
-    the card is still present.
-    
-======================================================================*/
-
 
 static struct pcmcia_device_id avmcs_ids[] = {
        PCMCIA_DEVICE_PROD_ID12("AVM", "ISDN-Controller B1", 0x95d42008, 0x845dc335),
@@ -424,8 +388,6 @@ static struct pcmcia_driver avmcs_driver = {
        .probe = avmcs_attach,
        .remove = avmcs_detach,
        .id_table = avmcs_ids,
-       .suspend= avmcs_suspend,
-       .resume = avmcs_resume,
 };
 
 static int __init avmcs_init(void)
index 845fa14e1bae80940f4a9fac2382838c1dafa71c..5e847cfb96f8c5e8f72542b34c6ecb4ff1afdeca 100644 (file)
@@ -383,28 +383,6 @@ static void avma1cs_release(dev_link_t *link)
        pcmcia_disable_device(link->handle);
 } /* avma1cs_release */
 
-static int avma1cs_suspend(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
-
-       return 0;
-}
-
-static int avma1cs_resume(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state &= ~DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_request_configuration(link->handle, &link->conf);
-
-       return 0;
-}
-
 
 static struct pcmcia_device_id avma1cs_ids[] = {
        PCMCIA_DEVICE_PROD_ID12("AVM", "ISDN A", 0x95d42008, 0xadc9d4bb),
@@ -421,10 +399,8 @@ static struct pcmcia_driver avma1cs_driver = {
        .probe          = avma1cs_attach,
        .remove         = avma1cs_detach,
        .id_table       = avma1cs_ids,
-       .suspend        = avma1cs_suspend,
-       .resume         = avma1cs_resume,
 };
+
 /*====================================================================*/
 
 static int __init init_avma1_cs(void)
index 60c75c7c016e5079c461d98cfc1cb175f96c5341..b76b303ebf6b35e5516a0a62907b3694d4affa5d 100644 (file)
@@ -389,10 +389,7 @@ static int elsa_suspend(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        local_info_t *dev = link->priv;
 
-       link->state |= DEV_SUSPEND;
         dev->busy = 1;
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
 
        return 0;
 }
@@ -402,9 +399,6 @@ static int elsa_resume(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        local_info_t *dev = link->priv;
 
-       link->state &= ~DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_request_configuration(link->handle, &link->conf);
         dev->busy = 0;
 
        return 0;
index fd0f127e40bac1e2a84e728d5b17012780762f89..5745eb1afe35882d7e5673f244915e5aab49e9a8 100644 (file)
@@ -472,10 +472,7 @@ static int sedlbauer_suspend(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        local_info_t *dev = link->priv;
 
-       link->state |= DEV_SUSPEND;
        dev->stop = 1;
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
 
        return 0;
 }
@@ -485,9 +482,6 @@ static int sedlbauer_resume(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        local_info_t *dev = link->priv;
 
-       link->state &= ~DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_request_configuration(link->handle, &link->conf);
        dev->stop = 0;
 
        return 0;
index 7945fd64621a3802a6ff351e291bbc1395bb1949..929507eb63af72a24653127d905dd572a9786be7 100644 (file)
@@ -380,10 +380,7 @@ static int teles_suspend(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        local_info_t *dev = link->priv;
 
-       link->state |= DEV_SUSPEND;
         dev->busy = 1;
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
 
        return 0;
 }
@@ -393,9 +390,6 @@ static int teles_resume(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        local_info_t *dev = link->priv;
 
-       link->state &= ~DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_request_configuration(link->handle, &link->conf);
         dev->busy = 0;
 
        return 0;
index 1799660bdc6731163d55cb72dec83bad73ad1768..8dfa30b3c70a3a6d4ce8810965c65cc6235279fe 100644 (file)
@@ -519,12 +519,8 @@ static int tc574_suspend(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG) {
-               if (link->open)
-                       netif_device_detach(dev);
-               pcmcia_release_configuration(link->handle);
-       }
+       if ((link->state & DEV_CONFIG) && (link->open))
+               netif_device_detach(dev);
 
        return 0;
 }
@@ -534,13 +530,9 @@ static int tc574_resume(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       link->state &= ~DEV_SUSPEND;
-       if (link->state & DEV_CONFIG) {
-               pcmcia_request_configuration(link->handle, &link->conf);
-               if (link->open) {
-                       tc574_reset(dev);
-                       netif_device_attach(dev);
-               }
+       if ((link->state & DEV_CONFIG) && (link->open)) {
+               tc574_reset(dev);
+               netif_device_attach(dev);
        }
 
        return 0;
index e36153851793f86228c322ba1536a8c1c45bb324..b15066be26f8f741ba7120e8c42c98dd33962f18 100644 (file)
@@ -394,12 +394,8 @@ static int tc589_suspend(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG) {
-               if (link->open)
-                       netif_device_detach(dev);
-               pcmcia_release_configuration(link->handle);
-       }
+       if ((link->state & DEV_CONFIG) && (link->open))
+               netif_device_detach(dev);
 
        return 0;
 }
@@ -409,13 +405,9 @@ static int tc589_resume(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       link->state &= ~DEV_SUSPEND;
-       if (link->state & DEV_CONFIG) {
-               pcmcia_request_configuration(link->handle, &link->conf);
-               if (link->open) {
-                       tc589_reset(dev);
-                       netif_device_attach(dev);
-               }
+       if ((link->state & DEV_CONFIG) && (link->open)) {
+               tc589_reset(dev);
+               netif_device_attach(dev);
        }
 
        return 0;
index 9b9c0f19b21cd4037b8e2a4bc1dc6973544ed58e..c34547c79245c10de0d83557bf8fd60d1ce37661 100644 (file)
@@ -464,12 +464,8 @@ static int axnet_suspend(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG) {
-               if (link->open)
+       if ((link->state & DEV_CONFIG) && (link->open))
                        netif_device_detach(dev);
-               pcmcia_release_configuration(link->handle);
-       }
 
        return 0;
 }
@@ -479,14 +475,10 @@ static int axnet_resume(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       link->state &= ~DEV_SUSPEND;
-       if (link->state & DEV_CONFIG) {
-               pcmcia_request_configuration(link->handle, &link->conf);
-               if (link->open) {
-                       axnet_reset_8390(dev);
-                       AX88190_init(dev, 1);
-                       netif_device_attach(dev);
-               }
+       if ((link->state & DEV_CONFIG) && (link->open)) {
+               axnet_reset_8390(dev);
+               AX88190_init(dev, 1);
+               netif_device_attach(dev);
        }
 
        return 0;
index a0ec5e7aacc60f299ec3511ea48d418fbdc0b2ff..0748c3d495448f14eb7759c7bbffd735ea126a21 100644 (file)
@@ -387,13 +387,8 @@ static int com20020_suspend(struct pcmcia_device *p_dev)
        com20020_dev_t *info = link->priv;
        struct net_device *dev = info->dev;
 
-       link->state |= DEV_SUSPEND;
-        if (link->state & DEV_CONFIG) {
-               if (link->open) {
-                       netif_device_detach(dev);
-               }
-               pcmcia_release_configuration(link->handle);
-        }
+       if ((link->state & DEV_CONFIG) && (link->open))
+               netif_device_detach(dev);
 
        return 0;
 }
@@ -404,15 +399,11 @@ static int com20020_resume(struct pcmcia_device *p_dev)
        com20020_dev_t *info = link->priv;
        struct net_device *dev = info->dev;
 
-       link->state &= ~DEV_SUSPEND;
-        if (link->state & DEV_CONFIG) {
-               pcmcia_request_configuration(link->handle, &link->conf);
-               if (link->open) {
-                       int ioaddr = dev->base_addr;
-                       struct arcnet_local *lp = dev->priv;
-                       ARCRESET;
-               }
-        }
+       if ((link->state & DEV_CONFIG) && (link->open)) {
+               int ioaddr = dev->base_addr;
+               struct arcnet_local *lp = dev->priv;
+               ARCRESET;
+       }
 
        return 0;
 }
index 6b435e9406079985279c79b49c2ce9fb0bd8762b..62efbc7c2dca6701be6f63c25a8c007576cce1e9 100644 (file)
@@ -683,13 +683,8 @@ static int fmvj18x_suspend(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG) {
-               if (link->open)
-                       netif_device_detach(dev);
-               pcmcia_release_configuration(link->handle);
-       }
-
+       if ((link->state & DEV_CONFIG) && (link->open))
+               netif_device_detach(dev);
 
        return 0;
 }
@@ -699,13 +694,9 @@ static int fmvj18x_resume(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       link->state &= ~DEV_SUSPEND;
-       if (link->state & DEV_CONFIG) {
-               pcmcia_request_configuration(link->handle, &link->conf);
-               if (link->open) {
-                       fjn_reset(dev);
-                       netif_device_attach(dev);
-               }
+       if ((link->state & DEV_CONFIG) && (link->open)) {
+               fjn_reset(dev);
+               netif_device_attach(dev);
        }
 
        return 0;
index 1948a0bc198d99b598a0c406a775bba8614eb0c9..6d7f8f52e175c7f31077656dc7842ed187abc592 100644 (file)
@@ -367,12 +367,8 @@ static int ibmtr_suspend(struct pcmcia_device *p_dev)
        ibmtr_dev_t *info = link->priv;
        struct net_device *dev = info->dev;
 
-       link->state |= DEV_SUSPEND;
-        if (link->state & DEV_CONFIG) {
-               if (link->open)
-                       netif_device_detach(dev);
-               pcmcia_release_configuration(link->handle);
-        }
+       if ((link->state & DEV_CONFIG) && (link->open))
+               netif_device_detach(dev);
 
        return 0;
 }
@@ -383,14 +379,10 @@ static int ibmtr_resume(struct pcmcia_device *p_dev)
        ibmtr_dev_t *info = link->priv;
        struct net_device *dev = info->dev;
 
-       link->state &= ~DEV_SUSPEND;
-        if (link->state & DEV_CONFIG) {
-               pcmcia_request_configuration(link->handle, &link->conf);
-               if (link->open) {
-                       ibmtr_probe(dev);       /* really? */
-                       netif_device_attach(dev);
-               }
-        }
+       if ((link->state & DEV_CONFIG) && (link->open)) {
+               ibmtr_probe(dev);       /* really? */
+               netif_device_attach(dev);
+       }
 
        return 0;
 }
index 76ef453d172d8d2baa82203ef0f8616031c731e8..cf2a50c015da2582e14dafab5df8f68e10d67dc9 100644 (file)
@@ -774,13 +774,8 @@ static int nmclan_suspend(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG) {
-               if (link->open)
-                       netif_device_detach(dev);
-               pcmcia_release_configuration(link->handle);
-       }
-
+       if ((link->state & DEV_CONFIG) && (link->open))
+               netif_device_detach(dev);
 
        return 0;
 }
@@ -790,13 +785,9 @@ static int nmclan_resume(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       link->state &= ~DEV_SUSPEND;
-       if (link->state & DEV_CONFIG) {
-               pcmcia_request_configuration(link->handle, &link->conf);
-               if (link->open) {
-                       nmclan_reset(dev);
-                       netif_device_attach(dev);
-               }
+       if ((link->state & DEV_CONFIG) && (link->open)) {
+               nmclan_reset(dev);
+               netif_device_attach(dev);
        }
 
        return 0;
index 52f44bdff1f7f61408d299cef61b1459f226ca10..3a2b731eeb3c5eaa3a33ddf50a7f3d3d97a4c8e2 100644 (file)
@@ -756,12 +756,8 @@ static int pcnet_suspend(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG) {
-               if (link->open)
-                       netif_device_detach(dev);
-               pcmcia_release_configuration(link->handle);
-       }
+       if ((link->state & DEV_CONFIG) && (link->open))
+               netif_device_detach(dev);
 
        return 0;
 }
@@ -771,14 +767,10 @@ static int pcnet_resume(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       link->state &= ~DEV_SUSPEND;
-       if (link->state & DEV_CONFIG) {
-               pcmcia_request_configuration(link->handle, &link->conf);
-               if (link->open) {
-                       pcnet_reset_8390(dev);
-                       NS8390_init(dev, 1);
-                       netif_device_attach(dev);
-               }
+       if ((link->state & DEV_CONFIG) && (link->open)) {
+               pcnet_reset_8390(dev);
+               NS8390_init(dev, 1);
+               netif_device_attach(dev);
        }
 
        return 0;
index 03b1d8fbe7b73c9f5ab72fa1f203b9f5c029287c..84e18bbed9d26f253d66cac7526cf415633bcbed 100644 (file)
@@ -874,7 +874,6 @@ static int smc91c92_suspend(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       link->state |= DEV_SUSPEND;
        if (link->state & DEV_CONFIG) {
                if (link->open)
                        netif_device_detach(dev);
@@ -891,7 +890,6 @@ static int smc91c92_resume(struct pcmcia_device *p_dev)
        struct smc_private *smc = netdev_priv(dev);
        int i;
 
-       link->state &= ~DEV_SUSPEND;
        if (link->state & DEV_CONFIG) {
                if ((smc->manfid == MANFID_MEGAHERTZ) &&
                    (smc->cardid == PRODID_MEGAHERTZ_EM3288))
index 2b57a87371f36d4380e04deedee8f96159791fce..19347bcb2f1583b1b6edc24fb09e5a6065ce8a1d 100644 (file)
@@ -1109,13 +1109,9 @@ static int xirc2ps_suspend(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG) {
-               if (link->open) {
+       if ((link->state & DEV_CONFIG) && (link->open)) {
                        netif_device_detach(dev);
                        do_powerdown(dev);
-               }
-               pcmcia_release_configuration(link->handle);
        }
 
        return 0;
@@ -1126,13 +1122,9 @@ static int xirc2ps_resume(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       link->state &= ~DEV_SUSPEND;
-       if (link->state & DEV_CONFIG) {
-               pcmcia_request_configuration(link->handle, &link->conf);
-               if (link->open) {
-                       do_reset(dev,1);
-                       netif_device_attach(dev);
-               }
+       if ((link->state & DEV_CONFIG) && (link->open)) {
+               do_reset(dev,1);
+               netif_device_attach(dev);
        }
 
        return 0;
index 489ef7f3d950e7e30adae53e33c5a9a818687277..adb90b679d7dae10200e69019a97f7f8d8eae9a4 100644 (file)
@@ -437,11 +437,8 @@ static int airo_suspend(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        local_info_t *local = link->priv;
 
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG) {
+       if (link->state & DEV_CONFIG)
                netif_device_detach(local->eth_dev);
-               pcmcia_release_configuration(link->handle);
-       }
 
        return 0;
 }
@@ -451,9 +448,7 @@ static int airo_resume(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        local_info_t *local = link->priv;
 
-       link->state &= ~DEV_SUSPEND;
-       if (link->state & DEV_CONFIG) {
-               pcmcia_request_configuration(link->handle, &link->conf);
+       if ((link->state & DEV_CONFIG) && (link->open)) {
                reset_airo_card(local->eth_dev);
                netif_device_attach(local->eth_dev);
        }
index 1da8e6197ffbb405c996712553a5f8f2c09f3b9c..89dbc783ff807218082936d7923c573d123750db 100644 (file)
@@ -433,11 +433,8 @@ static int atmel_suspend(struct pcmcia_device *dev)
        dev_link_t *link = dev_to_instance(dev);
        local_info_t *local = link->priv;
 
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG) {
+       if (link->state & DEV_CONFIG)
                netif_device_detach(local->eth_dev);
-               pcmcia_release_configuration(link->handle);
-       }
 
        return 0;
 }
@@ -447,9 +444,7 @@ static int atmel_resume(struct pcmcia_device *dev)
        dev_link_t *link = dev_to_instance(dev);
        local_info_t *local = link->priv;
 
-       link->state &= ~DEV_SUSPEND;
        if (link->state & DEV_CONFIG) {
-               pcmcia_request_configuration(link->handle, &link->conf);
                atmel_open(local->eth_dev);
                netif_device_attach(local->eth_dev);
        }
index 7a1023f3875b79a942f0059b67d3b8e63aafb08b..0fb62518545223a4499253511105fd431d197fe3 100644 (file)
@@ -816,8 +816,6 @@ static int hostap_cs_suspend(struct pcmcia_device *p_dev)
 
        PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_SUSPEND\n", dev_info);
 
-       link->state |= DEV_SUSPEND;
-
        if (link->state & DEV_CONFIG) {
                struct hostap_interface *iface = netdev_priv(dev);
                if (iface && iface->local)
@@ -827,7 +825,6 @@ static int hostap_cs_suspend(struct pcmcia_device *p_dev)
                        netif_device_detach(dev);
                }
                prism2_suspend(dev);
-               pcmcia_release_configuration(link->handle);
        }
 
        return 0;
@@ -841,14 +838,11 @@ static int hostap_cs_resume(struct pcmcia_device *p_dev)
 
        PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_RESUME\n", dev_info);
 
-       link->state &= ~DEV_SUSPEND;
        if (link->state & DEV_CONFIG) {
                struct hostap_interface *iface = netdev_priv(dev);
                if (iface && iface->local)
                        dev_open = iface->local->num_dev_open > 0;
 
-               pcmcia_request_configuration(link->handle, &link->conf);
-
                prism2_hw_shutdown(dev, 1);
                prism2_hw_config(dev, dev_open ? 0 : 1);
                if (dev_open) {
index dfb47ac9da5051f7d8693b21bd1ad3c1ee576ee1..545717b5e1e53174074e889b8673cf47211cdff3 100644 (file)
@@ -884,12 +884,8 @@ static int netwave_suspend(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG) {
-               if (link->open)
-                       netif_device_detach(dev);
-               pcmcia_release_configuration(link->handle);
-       }
+       if ((link->state & DEV_CONFIG) && (link->open))
+               netif_device_detach(dev);
 
        return 0;
 }
@@ -899,13 +895,9 @@ static int netwave_resume(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       link->state &= ~DEV_SUSPEND;
-       if (link->state & DEV_CONFIG) {
-               pcmcia_request_configuration(link->handle, &link->conf);
-               if (link->open) {
-                       netwave_reset(dev);
-                       netif_device_attach(dev);
-               }
+       if ((link->state & DEV_CONFIG) && (link->open)) {
+               netwave_reset(dev);
+               netif_device_attach(dev);
        }
 
        return 0;
index 0ce4165efc8ffa3249d5c0511d38a18500c7e9a6..89e16cd1be8cdd279618a5d2ac823baf98232c95 100644 (file)
@@ -429,7 +429,6 @@ static int orinoco_cs_suspend(struct pcmcia_device *p_dev)
        int err = 0;
        unsigned long flags;
 
-       link->state |= DEV_SUSPEND;
        if (link->state & DEV_CONFIG) {
                /* This is probably racy, but I can't think of
                   a better way, short of rewriting the PCMCIA
@@ -447,8 +446,6 @@ static int orinoco_cs_suspend(struct pcmcia_device *p_dev)
 
                        spin_unlock_irqrestore(&priv->lock, flags);
                }
-
-               pcmcia_release_configuration(link->handle);
        }
 
        return 0;
@@ -463,12 +460,7 @@ static int orinoco_cs_resume(struct pcmcia_device *p_dev)
        int err = 0;
        unsigned long flags;
 
-       link->state &= ~DEV_SUSPEND;
        if (link->state & DEV_CONFIG) {
-               /* FIXME: should we double check that this is
-                * the same card as we had before */
-               pcmcia_request_configuration(link->handle, &link->conf);
-
                if (! test_bit(0, &card->hard_reset_in_progress)) {
                        err = orinoco_reinit_firmware(dev);
                        if (err) {
index fc81ac67009d8924771f24d9a3c721bdaeb5df41..ed4bf5013f1a683a198dc6f999802ab0f904ae74 100644 (file)
@@ -868,14 +868,8 @@ static int ray_suspend(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       link->state |= DEV_SUSPEND;
-        if (link->state & DEV_CONFIG) {
-               if (link->open)
-                       netif_device_detach(dev);
-
-               pcmcia_release_configuration(link->handle);
-        }
-
+       if ((link->state & DEV_CONFIG) && (link->open))
+               netif_device_detach(dev);
 
        return 0;
 }
@@ -885,14 +879,10 @@ static int ray_resume(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       link->state &= ~DEV_SUSPEND;
-        if (link->state & DEV_CONFIG) {
-               pcmcia_request_configuration(link->handle, &link->conf);
-               if (link->open) {
-                       ray_reset(dev);
-                       netif_device_attach(dev);
-               }
-        }
+       if ((link->state & DEV_CONFIG) && (link->open)) {
+               ray_reset(dev);
+               netif_device_attach(dev);
+       }
 
        return 0;
 }
index b7ed99f8d319f8bf4628f96cd168c02c5f46a5cd..0429f1dc7fadda721ed0dd1329826fe80e597ced 100644 (file)
@@ -908,7 +908,6 @@ spectrum_cs_suspend(struct pcmcia_device *p_dev)
        unsigned long flags;
        int err = 0;
 
-       link->state |= DEV_SUSPEND;
        /* Mark the device as stopped, to block IO until later */
        if (link->state & DEV_CONFIG) {
                spin_lock_irqsave(&priv->lock, flags);
@@ -922,8 +921,6 @@ spectrum_cs_suspend(struct pcmcia_device *p_dev)
                priv->hw_unavailable++;
 
                spin_unlock_irqrestore(&priv->lock, flags);
-
-               pcmcia_release_configuration(link->handle);
        }
 
        return 0;
@@ -936,11 +933,7 @@ spectrum_cs_resume(struct pcmcia_device *p_dev)
        struct net_device *dev = link->priv;
        struct orinoco_private *priv = netdev_priv(dev);
 
-       link->state &= ~DEV_SUSPEND;
        if (link->state & DEV_CONFIG) {
-               /* FIXME: should we double check that this is
-                * the same card as we had before */
-               pcmcia_request_configuration(link->handle, &link->conf);
                netif_device_attach(dev);
                priv->hw_unavailable--;
                schedule_work(&priv->reset_work);
index 696aeb9d8f521390acdc388bfa02f05c7761aede..8cabcfe3a654e6b553c22ddc1eedf3d9a2b314d3 100644 (file)
@@ -4742,19 +4742,12 @@ static int wavelan_suspend(struct pcmcia_device *p_dev)
        /* Stop receiving new messages and wait end of transmission */
        wv_ru_stop(dev);
 
+       if ((link->state & DEV_CONFIG) && (link->open))
+               netif_device_detach(dev);
+
        /* Power down the module */
        hacr_write(dev->base_addr, HACR_DEFAULT & (~HACR_PWR_STAT));
 
-       /* The card is now suspended */
-       link->state |= DEV_SUSPEND;
-
-       if(link->state & DEV_CONFIG)
-       {
-               if(link->open)
-                       netif_device_detach(dev);
-               pcmcia_release_configuration(link->handle);
-       }
-
        return 0;
 }
 
@@ -4764,14 +4757,9 @@ static int wavelan_resume(struct pcmcia_device *p_dev)
        struct net_device *     dev = (struct net_device *) link->priv;
 
        link->state &= ~DEV_SUSPEND;
-       if(link->state & DEV_CONFIG)
-       {
-               pcmcia_request_configuration(link->handle, &link->conf);
-               if(link->open)  /* If RESET -> True, If RESUME -> False ? */
-               {
-                       wv_hw_reset(dev);
-                       netif_device_attach(dev);
-               }
+       if ((link->state & DEV_CONFIG) && (link->open)) {
+               wv_hw_reset(dev);
+               netif_device_attach(dev);
        }
 
        return 0;
index 0c81b3e7d7ff9621ae2379ad397bb4bdc808730b..3a93a8bb2e1f2958ca9705ed2ae2306b1ac83e28 100644 (file)
@@ -2160,14 +2160,9 @@ static int wl3501_suspend(struct pcmcia_device *p_dev)
        dev_link_t *link = dev_to_instance(p_dev);
        struct net_device *dev = link->priv;
 
-       link->state |= DEV_SUSPEND;
-
        wl3501_pwr_mgmt(dev->priv, WL3501_SUSPEND);
-       if (link->state & DEV_CONFIG) {
-               if (link->open)
-                       netif_device_detach(dev);
-               pcmcia_release_configuration(link->handle);
-       }
+       if ((link->state & DEV_CONFIG) && (link->open))
+               netif_device_detach(dev);
 
        return 0;
 }
@@ -2178,12 +2173,9 @@ static int wl3501_resume(struct pcmcia_device *p_dev)
        struct net_device *dev = link->priv;
 
        wl3501_pwr_mgmt(dev->priv, WL3501_RESUME);
-       if (link->state & DEV_CONFIG) {
-               pcmcia_request_configuration(link->handle, &link->conf);
-               if (link->open) {
-                       wl3501_reset(dev);
-                       netif_device_attach(dev);
-               }
+       if ((link->state & DEV_CONFIG) && (link->open)) {
+               wl3501_reset(dev);
+               netif_device_attach(dev);
        }
 
        return 0;
index 7edd7ef6c31f3f74c3dd42a633cc142fede6f479..5e12ed2f1b6ed42b57cfa1d4f50de4b1fe39dfa3 100644 (file)
@@ -280,27 +280,6 @@ void parport_cs_release(dev_link_t *link)
        pcmcia_disable_device(link->handle);
 } /* parport_cs_release */
 
-static int parport_suspend(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
-
-       return 0;
-}
-
-static int parport_resume(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state &= ~DEV_SUSPEND;
-       if (DEV_OK(link))
-               pcmcia_request_configuration(link->handle, &link->conf);
-
-       return 0;
-}
 
 static struct pcmcia_device_id parport_ids[] = {
        PCMCIA_DEVICE_FUNC_ID(3),
@@ -317,8 +296,6 @@ static struct pcmcia_driver parport_cs_driver = {
        .probe          = parport_attach,
        .remove         = parport_detach,
        .id_table       = parport_ids,
-       .suspend        = parport_suspend,
-       .resume         = parport_resume,
 };
 
 static int __init init_parport_cs(void)
index 16159e9d1b2b8072d70f58086bfd79351de60204..ec2d4166a2e3f8748ea151b63cacde8d56ab93c5 100644 (file)
@@ -10,7 +10,7 @@
  * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
  *
  * (C) 1999            David A. Hinds
- * (C) 2003 - 2005     Dominik Brodowski
+ * (C) 2003 - 2006     Dominik Brodowski
  */
 
 #include <linux/kernel.h>
@@ -1030,12 +1030,22 @@ static int pcmcia_dev_suspend(struct device * dev, pm_message_t state)
 {
        struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
        struct pcmcia_driver *p_drv = NULL;
+       int ret;
 
        if (dev->driver)
                p_drv = to_pcmcia_drv(dev->driver);
 
-       if (p_drv && p_drv->suspend)
-               return p_drv->suspend(p_dev);
+       if (p_drv && p_drv->suspend) {
+               ret = p_drv->suspend(p_dev);
+               if (ret)
+                       return ret;
+               if (p_dev->instance) {
+                       p_dev->instance->state |= DEV_SUSPEND;
+                       if ((p_dev->instance->state & DEV_CONFIG) &&
+                           !(p_dev->instance->state & DEV_SUSPEND_NORELEASE))
+                               pcmcia_release_configuration(p_dev);
+               }
+       }
 
        return 0;
 }
@@ -1045,12 +1055,24 @@ static int pcmcia_dev_resume(struct device * dev)
 {
        struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
         struct pcmcia_driver *p_drv = NULL;
+       int ret;
 
        if (dev->driver)
                p_drv = to_pcmcia_drv(dev->driver);
 
-       if (p_drv && p_drv->resume)
+       if (p_drv && p_drv->resume) {
+               if (p_dev->instance) {
+                       p_dev->instance->state &= ~DEV_SUSPEND;
+                       if ((p_dev->instance->state & DEV_CONFIG) &&
+                           !(p_dev->instance->state & DEV_SUSPEND_NORELEASE)){
+                               ret = pcmcia_request_configuration(p_dev,
+                                                &p_dev->instance->conf);
+                               if (ret)
+                                       return ret;
+                       }
+               }
                return p_drv->resume(p_dev);
+       }
 
        return 0;
 }
index e7f9d26a0d7ca0e8b12354c767505303cdc7309e..7fbef1e516854f4a46f9195752d816c734d418db 100644 (file)
@@ -251,27 +251,12 @@ static void aha152x_release_cs(dev_link_t *link)
        pcmcia_disable_device(link->handle);
 }
 
-static int aha152x_suspend(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
-
-       return 0;
-}
-
 static int aha152x_resume(struct pcmcia_device *dev)
 {
        dev_link_t *link = dev_to_instance(dev);
        scsi_info_t *info = link->priv;
 
-       link->state &= ~DEV_SUSPEND;
-       if (link->state & DEV_CONFIG) {
-               pcmcia_request_configuration(link->handle, &link->conf);
-               aha152x_host_reset_host(info->host);
-       }
+       aha152x_host_reset_host(info->host);
 
        return 0;
 }
@@ -294,7 +279,6 @@ static struct pcmcia_driver aha152x_cs_driver = {
        .probe          = aha152x_attach,
        .remove         = aha152x_detach,
        .id_table       = aha152x_ids,
-       .suspend        = aha152x_suspend,
        .resume         = aha152x_resume,
 };
 
index fb7221cf511fcda8768b37a418fbc2e541c6183f..20b9b27c60dd3d0cf174c28d8109138ed931c8df 100644 (file)
@@ -220,26 +220,12 @@ static void fdomain_release(dev_link_t *link)
 
 /*====================================================================*/
 
-static int fdomain_suspend(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
-
-       return 0;
-}
-
 static int fdomain_resume(struct pcmcia_device *dev)
 {
        dev_link_t *link = dev_to_instance(dev);
 
-       link->state &= ~DEV_SUSPEND;
-       if (link->state & DEV_CONFIG) {
-               pcmcia_request_configuration(link->handle, &link->conf);
+       if (link->state & DEV_CONFIG)
                fdomain_16x0_bus_reset(NULL);
-       }
 
        return 0;
 }
@@ -260,7 +246,6 @@ static struct pcmcia_driver fdomain_cs_driver = {
        .probe          = fdomain_attach,
        .remove         = fdomain_detach,
        .id_table       = fdomain_ids,
-       .suspend        = fdomain_suspend,
        .resume         = fdomain_resume,
 };
 
index d469e0d162240516788f4a939263d7df28280b8d..e313b40b7043d5ee048a8c5430118953e66c0f04 100644 (file)
@@ -1987,8 +1987,6 @@ static int nsp_cs_suspend(struct pcmcia_device *dev)
        scsi_info_t *info = link->priv;
        nsp_hw_data *data;
 
-       link->state |= DEV_SUSPEND;
-
        nsp_dbg(NSP_DEBUG_INIT, "event: suspend");
 
        if (info->host != NULL) {
@@ -2001,9 +1999,6 @@ static int nsp_cs_suspend(struct pcmcia_device *dev)
 
        info->stop = 1;
 
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
-
        return 0;
 }
 
@@ -2015,11 +2010,6 @@ static int nsp_cs_resume(struct pcmcia_device *dev)
 
        nsp_dbg(NSP_DEBUG_INIT, "event: resume");
 
-       link->state &= ~DEV_SUSPEND;
-
-       if (link->state & DEV_CONFIG)
-               pcmcia_request_configuration(link->handle, &link->conf);
-
        info->stop = 0;
 
        if (info->host != NULL) {
index 1e27059cd46209bb56845bcf239fbc5f7880c4bb..5a8da5143bd145bdd289e0c832586cc30ab41c98 100644 (file)
@@ -311,22 +311,10 @@ static void qlogic_release(dev_link_t *link)
 
 /*====================================================================*/
 
-static int qlogic_suspend(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
-
-       return 0;
-}
-
 static int qlogic_resume(struct pcmcia_device *dev)
 {
        dev_link_t *link = dev_to_instance(dev);
 
-       link->state &= ~DEV_SUSPEND;
        if (link->state & DEV_CONFIG) {
                scsi_info_t *info = link->priv;
 
@@ -375,7 +363,6 @@ static struct pcmcia_driver qlogic_cs_driver = {
        .probe          = qlogic_attach,
        .remove         = qlogic_detach,
        .id_table       = qlogic_ids,
-       .suspend        = qlogic_suspend,
        .resume         = qlogic_resume,
 };
 
index 42d002b6d1a53f2a337e84b8a92b0503dbbc3122..4a6988567de5dc3d3473ba94ad8b1fa2459dfdb6 100644 (file)
@@ -857,26 +857,12 @@ cs_failed:
        return;
 } /* SYM53C500_config */
 
-static int sym53c500_suspend(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
-
-       return 0;
-}
-
 static int sym53c500_resume(struct pcmcia_device *dev)
 {
        dev_link_t *link = dev_to_instance(dev);
        struct scsi_info_t *info = link->priv;
 
-       link->state &= ~DEV_SUSPEND;
        if (link->state & DEV_CONFIG) {
-               pcmcia_request_configuration(link->handle, &link->conf);
-
                /* See earlier comment about manufacturer IDs. */
                if ((info->manf_id == MANFID_MACNICA) ||
                    (info->manf_id == MANFID_PIONEER) ||
@@ -963,7 +949,6 @@ static struct pcmcia_driver sym53c500_cs_driver = {
        .probe          = SYM53C500_attach,
        .remove         = SYM53C500_detach,
        .id_table       = sym53c500_ids,
-       .suspend        = sym53c500_suspend,
        .resume         = sym53c500_resume,
 };
 
index ff38820a03f549b603e6bd262b2ce353a7ce9a99..b6b460fa693f47c313a9c1eb855eec1981431928 100644 (file)
@@ -151,7 +151,6 @@ static void serial_remove(dev_link_t *link)
 static int serial_suspend(struct pcmcia_device *dev)
 {
        dev_link_t *link = dev_to_instance(dev);
-       link->state |= DEV_SUSPEND;
 
        if (link->state & DEV_CONFIG) {
                struct serial_info *info = link->priv;
@@ -160,8 +159,8 @@ static int serial_suspend(struct pcmcia_device *dev)
                for (i = 0; i < info->ndev; i++)
                        serial8250_suspend_port(info->line[i]);
 
-               if (!info->slave)
-                       pcmcia_release_configuration(link->handle);
+               if (info->slave)
+                       link->state &= DEV_SUSPEND_NORELEASE;
        }
 
        return 0;
@@ -170,15 +169,11 @@ static int serial_suspend(struct pcmcia_device *dev)
 static int serial_resume(struct pcmcia_device *dev)
 {
        dev_link_t *link = dev_to_instance(dev);
-       link->state &= ~DEV_SUSPEND;
 
        if (DEV_OK(link)) {
                struct serial_info *info = link->priv;
                int i;
 
-               if (!info->slave)
-                       pcmcia_request_configuration(link->handle, &link->conf);
-
                for (i = 0; i < info->ndev; i++)
                        serial8250_resume_port(info->line[i]);
        }
index fe3cde0da84afe6228790f368de6520b29a60a71..509465586ded825f964dce4cf7f70533db5f398a 100644 (file)
@@ -232,28 +232,6 @@ static void ixj_cs_release(dev_link_t *link)
        pcmcia_disable_device(link->handle);
 }
 
-static int ixj_suspend(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
-
-       return 0;
-}
-
-static int ixj_resume(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state &= ~DEV_SUSPEND;
-       if (DEV_OK(link))
-               pcmcia_request_configuration(link->handle, &link->conf);
-
-       return 0;
-}
-
 static struct pcmcia_device_id ixj_ids[] = {
        PCMCIA_DEVICE_MANF_CARD(0x0257, 0x0600),
        PCMCIA_DEVICE_NULL
@@ -268,8 +246,6 @@ static struct pcmcia_driver ixj_driver = {
        .probe          = ixj_attach,
        .remove         = ixj_detach,
        .id_table       = ixj_ids,
-       .suspend        = ixj_suspend,
-       .resume         = ixj_resume,
 };
 
 static int __init ixj_pcmcia_init(void)
index ee811673d903138177fe7218b5d684b09a542842..ca3fc336d3d769bba2217724739a8c41d8d201a7 100644 (file)
@@ -293,28 +293,6 @@ cs_failed:
        }
 }
 
-static int sl811_suspend(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state |= DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
-
-       return 0;
-}
-
-static int sl811_resume(struct pcmcia_device *dev)
-{
-       dev_link_t *link = dev_to_instance(dev);
-
-       link->state &= ~DEV_SUSPEND;
-       if (link->state & DEV_CONFIG)
-               pcmcia_request_configuration(link->handle, &link->conf);
-
-       return 0;
-}
-
 static int sl811_cs_attach(struct pcmcia_device *p_dev)
 {
        local_info_t *local;
@@ -359,8 +337,6 @@ static struct pcmcia_driver sl811_cs_driver = {
        .probe          = sl811_cs_attach,
        .remove         = sl811_cs_detach,
        .id_table       = sl811_ids,
-       .suspend        = sl811_suspend,
-       .resume         = sl811_resume,
 };
 
 /*====================================================================*/
index ce76ab587df64e788c379f0507540af3bcff417a..8a6a95ea26ecdc6d35861a5ee4eaa5aec0442529 100644 (file)
@@ -118,8 +118,7 @@ typedef struct dev_link_t {
 /* Flags for device state */
 #define DEV_PRESENT            0x01
 #define DEV_CONFIG             0x02
-#define DEV_STALE_CONFIG       0x04    /* release on close */
-#define DEV_STALE_LINK         0x08    /* detach on release */
+#define DEV_SUSPEND_NORELEASE  0x04
 #define DEV_CONFIG_PENDING     0x10
 #define DEV_RELEASE_PENDING    0x20
 #define DEV_SUSPEND            0x40
index 80c53553b8153da64dd6da2a41eb907d92a9ffff..31f4bdc46ce60d8dc5d1542cfd6964900acc0807 100644 (file)
@@ -284,16 +284,11 @@ static int pdacf_suspend(struct pcmcia_device *dev)
        struct snd_pdacf *chip = link->priv;
 
        snd_printdd(KERN_DEBUG "SUSPEND\n");
-       link->state |= DEV_SUSPEND;
        if (chip) {
                snd_printdd(KERN_DEBUG "snd_pdacf_suspend calling\n");
                snd_pdacf_suspend(chip, PMSG_SUSPEND);
        }
 
-       snd_printdd(KERN_DEBUG "RESET_PHYSICAL\n");
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
-
        return 0;
 }
 
@@ -303,12 +298,7 @@ static int pdacf_resume(struct pcmcia_device *dev)
        struct snd_pdacf *chip = link->priv;
 
        snd_printdd(KERN_DEBUG "RESUME\n");
-       link->state &= ~DEV_SUSPEND;
-
-       snd_printdd(KERN_DEBUG "CARD_RESET\n");
        if (DEV_OK(link)) {
-               snd_printdd(KERN_DEBUG "requestconfig...\n");
-               pcmcia_request_configuration(link->handle, &link->conf);
                if (chip) {
                        snd_printdd(KERN_DEBUG "calling snd_pdacf_resume\n");
                        snd_pdacf_resume(chip);
index 8093e5044956e0d6068169d628ddc4bef3907922..e101e05afac33a3a06e7bfcf118c0e9dc1b440d6 100644 (file)
@@ -284,14 +284,10 @@ static int vxp_suspend(struct pcmcia_device *dev)
        struct vx_core *chip = link->priv;
 
        snd_printdd(KERN_DEBUG "SUSPEND\n");
-       link->state |= DEV_SUSPEND;
        if (chip) {
                snd_printdd(KERN_DEBUG "snd_vx_suspend calling\n");
                snd_vx_suspend(chip, PMSG_SUSPEND);
        }
-       snd_printdd(KERN_DEBUG "RESET_PHYSICAL\n");
-       if (link->state & DEV_CONFIG)
-               pcmcia_release_configuration(link->handle);
 
        return 0;
 }
@@ -302,13 +298,8 @@ static int vxp_resume(struct pcmcia_device *dev)
        struct vx_core *chip = link->priv;
 
        snd_printdd(KERN_DEBUG "RESUME\n");
-       link->state &= ~DEV_SUSPEND;
-
-       snd_printdd(KERN_DEBUG "CARD_RESET\n");
        if (DEV_OK(link)) {
                //struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip;
-               snd_printdd(KERN_DEBUG "requestconfig...\n");
-               pcmcia_request_configuration(link->handle, &link->conf);
                if (chip) {
                        snd_printdd(KERN_DEBUG "calling snd_vx_resume\n");
                        snd_vx_resume(chip);