[PATCH] pcmcia: convert remaining users of pcmcia_release_io and _irq
authorDominik Brodowski <linux@dominikbrodowski.net>
Sun, 15 Jan 2006 09:05:19 +0000 (10:05 +0100)
committerDominik Brodowski <linux@dominikbrodowski.net>
Fri, 31 Mar 2006 15:15:51 +0000 (17:15 +0200)
Convert the remaining drivers which use pcmcia_release_io or
pcmcia_release_irq, and remove the EXPORT of these symbols.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
16 files changed:
Documentation/pcmcia/driver-changes.txt
drivers/isdn/hardware/avm/avm_cs.c
drivers/isdn/hisax/avma1_cs.c
drivers/isdn/hisax/sedlbauer_cs.c
drivers/net/pcmcia/smc91c92_cs.c
drivers/net/wireless/orinoco_cs.c
drivers/net/wireless/ray_cs.c
drivers/net/wireless/spectrum_cs.c
drivers/pcmcia/pcmcia_resource.c
drivers/scsi/pcmcia/nsp_cs.c
drivers/scsi/pcmcia/qlogic_stub.c
drivers/telephony/ixj_pcmcia.c
drivers/usb/host/sl811_cs.c
include/pcmcia/cs.h
sound/pcmcia/pdaudiocf/pdaudiocf.c
sound/pcmcia/vx/vxpocket.c

index c89a5e29bb4c2b9e6fc416bd048a1afc6f28adcc..4739c5c3face33164587d55749eb3f2f98c3674d 100644 (file)
@@ -3,8 +3,8 @@ This file details changes in 2.6 which affect PCMCIA card driver authors:
 * New release helper (as of 2.6.17)
    Instead of calling pcmcia_release_{configuration,io,irq,win}, all that's
    necessary now is calling pcmcia_disable_device. As there is no valid
-   reason left to call pcmcia_release_io and pcmcia_release_irq, they will
-   be removed soon.
+   reason left to call pcmcia_release_io and pcmcia_release_irq, the
+   exports for them were removed.
 
 * Unify detach and REMOVAL event code, as well as attach and INSERTION
   code (as of 2.6.16)
index f3889bdc8e43abeba491c6be8a357e228a6bd427..5f70661994d86e14387dc4c9b53cc0e1b2ece2c9 100644 (file)
@@ -284,25 +284,25 @@ found_port:
            cs_error(link->handle, RequestIO, i);
            break;
        }
-       
+
        /*
         * allocate an interrupt line
         */
        i = pcmcia_request_irq(link->handle, &link->irq);
        if (i != CS_SUCCESS) {
            cs_error(link->handle, RequestIRQ, i);
-           pcmcia_release_io(link->handle, &link->io);
+           /* undo */
+           pcmcia_disable_device(link->handle);
            break;
        }
-       
+
        /*
          * configure the PCMCIA socket
          */
        i = pcmcia_request_configuration(link->handle, &link->conf);
        if (i != CS_SUCCESS) {
            cs_error(link->handle, RequestConfiguration, i);
-           pcmcia_release_io(link->handle, &link->io);
-           pcmcia_release_irq(link->handle, &link->irq);
+           pcmcia_disable_device(link->handle);
            break;
        }
 
index 729c2de0bc1d270fdb9ced9e299ca96e115e63b9..845fa14e1bae80940f4a9fac2382838c1dafa71c 100644 (file)
@@ -313,18 +313,18 @@ found_port:
        i = pcmcia_request_irq(link->handle, &link->irq);
        if (i != CS_SUCCESS) {
            cs_error(link->handle, RequestIRQ, i);
-           pcmcia_release_io(link->handle, &link->io);
+           /* undo */
+           pcmcia_disable_device(link->handle);
            break;
        }
-       
+
        /*
         * configure the PCMCIA socket
         */
        i = pcmcia_request_configuration(link->handle, &link->conf);
        if (i != CS_SUCCESS) {
            cs_error(link->handle, RequestConfiguration, i);
-           pcmcia_release_io(link->handle, &link->io);
-           pcmcia_release_irq(link->handle, &link->irq);
+           pcmcia_disable_device(link->handle);
            break;
        }
 
index e59539157d195e2d85a5eed9f33e25952761e990..fd0f127e40bac1e2a84e728d5b17012780762f89 100644 (file)
@@ -374,15 +374,11 @@ static void sedlbauer_config(dev_link_t *link)
        }
        /* If we got this far, we're cool! */
        break;
-       
+
     next_entry:
-/* new in dummy.cs 2001/01/28 MN 
-        if (link->io.NumPorts1)
-           pcmcia_release_io(link->handle, &link->io);
-*/
        CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple));
     }
-    
+
     /*
        Allocate an interrupt line.  Note that this does not assign a
        handler to the interrupt, unless the 'Handler' member of the
index 56700b154d44ce4336c29fa7b519a727e4a25cb4..03b1d8fbe7b73c9f5ab72fa1f203b9f5c029287c 100644 (file)
@@ -49,6 +49,7 @@
 #include <pcmcia/cisreg.h>
 #include <pcmcia/ciscode.h>
 #include <pcmcia/ds.h>
+#include <pcmcia/ss.h>
 
 #include <asm/io.h>
 #include <asm/system.h>
@@ -965,10 +966,15 @@ static int check_sig(dev_link_t *link)
 
     if (width) {
        printk(KERN_INFO "smc91c92_cs: using 8-bit IO window.\n");
+       /* call pcmcia_release_configuration() in _suspend */
        smc91c92_suspend(link->handle);
-       pcmcia_release_io(link->handle, &link->io);
+
        link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-       pcmcia_request_io(link->handle, &link->io);
+       link->handle->socket->io[0].res->flags &= ~IO_DATA_PATH_WIDTH;
+       link->handle->socket->io[0].res->flags |= IO_DATA_PATH_WIDTH_8;
+
+       /* call pcmcia_request_configuration() in _resume, it handles the
+        * flag update */
        smc91c92_resume(link->handle);
        return check_sig(link);
     }
index 7fdc4ff551076e15c2510a7b1f5768263daee40a..0ce4165efc8ffa3249d5c0511d38a18500c7e9a6 100644 (file)
@@ -317,8 +317,7 @@ orinoco_cs_config(dev_link_t *link)
                break;
                
        next_entry:
-               if (link->io.NumPorts1)
-                       pcmcia_release_io(link->handle, &link->io);
+               pcmcia_disable_device(handle);
                last_ret = pcmcia_get_next_tuple(handle, &tuple);
                if (last_ret  == CS_NO_MORE_ITEMS) {
                        printk(KERN_ERR PFX "GetNextTuple(): No matching "
index 7880d8c31aadc20abb96e554af606d4a337663f1..fc81ac67009d8924771f24d9a3c721bdaeb5df41 100644 (file)
@@ -849,22 +849,16 @@ static void ray_release(dev_link_t *link)
     DEBUG(1, "ray_release(0x%p)\n", link);
 
     del_timer(&local->timer);
-    link->state &= ~DEV_CONFIG;
 
     iounmap(local->sram);
     iounmap(local->rmem);
     iounmap(local->amem);
     /* Do bother checking to see if these succeed or not */
-    i = pcmcia_release_window(link->win);
-    if ( i != CS_SUCCESS ) DEBUG(0,"ReleaseWindow(link->win) ret = %x\n",i);
     i = pcmcia_release_window(local->amem_handle);
     if ( i != CS_SUCCESS ) DEBUG(0,"ReleaseWindow(local->amem) ret = %x\n",i);
     i = pcmcia_release_window(local->rmem_handle);
     if ( i != CS_SUCCESS ) DEBUG(0,"ReleaseWindow(local->rmem) ret = %x\n",i);
-    i = pcmcia_release_configuration(link->handle);
-    if ( i != CS_SUCCESS ) DEBUG(0,"ReleaseConfiguration ret = %x\n",i);
-    i = pcmcia_release_irq(link->handle, &link->irq);
-    if ( i != CS_SUCCESS ) DEBUG(0,"ReleaseIRQ ret = %x\n",i);
+    pcmcia_disable_device(link->handle);
 
     DEBUG(2,"ray_release ending\n");
 }
index 78320c1a1c15eaf463d7939dea14c34fd45c0316..b7ed99f8d319f8bf4628f96cd168c02c5f46a5cd 100644 (file)
@@ -790,8 +790,7 @@ spectrum_cs_config(dev_link_t *link)
                break;
                
        next_entry:
-               if (link->io.NumPorts1)
-                       pcmcia_release_io(link->handle, &link->io);
+               pcmcia_disable_device(handle);
                last_ret = pcmcia_get_next_tuple(handle, &tuple);
                if (last_ret  == CS_NO_MORE_ITEMS) {
                        printk(KERN_ERR PFX "GetNextTuple(): No matching "
index 555c8698ebd904ea6831c0eb5dce754370047c8f..f4dcea6ac44bf4116179b3b502da1dfac3556795 100644 (file)
@@ -514,7 +514,6 @@ int pcmcia_release_io(struct pcmcia_device *p_dev, io_req_t *req)
 
        return CS_SUCCESS;
 } /* pcmcia_release_io */
-EXPORT_SYMBOL(pcmcia_release_io);
 
 
 int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req)
@@ -547,7 +546,6 @@ int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req)
 
        return CS_SUCCESS;
 } /* pcmcia_release_irq */
-EXPORT_SYMBOL(pcmcia_release_irq);
 
 
 int pcmcia_release_window(window_handle_t win)
@@ -937,6 +935,5 @@ void pcmcia_disable_device(struct pcmcia_device *p_dev) {
                pcmcia_release_window(p_dev->instance->win);
 
        p_dev->instance->dev = NULL;
-       p_dev->instance->state &= ~DEV_CONFIG;
 }
 EXPORT_SYMBOL(pcmcia_disable_device);
index dd383c538d98f0a637bd07bacbc37c2edc6dbc3a..d469e0d162240516788f4a939263d7df28280b8d 100644 (file)
@@ -1802,10 +1802,7 @@ static void nsp_cs_config(dev_link_t *link)
 
        next_entry:
                nsp_dbg(NSP_DEBUG_INIT, "next");
-
-               if (link->io.NumPorts1) {
-                       pcmcia_release_io(link->handle, &link->io);
-               }
+               pcmcia_disable_device(handle);
                CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple));
        }
 
index 70269fc10f300c325a154417e4a8f2438a458984..1e27059cd46209bb56845bcf239fbc5f7880c4bb 100644 (file)
@@ -288,12 +288,7 @@ out:
 
 cs_failed:
        cs_error(link->handle, last_fn, last_ret);
-       link->dev = NULL;
-
-       pcmcia_release_configuration(link->handle);
-       pcmcia_release_io(link->handle, &link->io);
-       pcmcia_release_irq(link->handle, &link->irq);
-       link->state &= ~DEV_CONFIG;
+       pcmcia_disable_device(link->handle);
        return;
 
 }                              /* qlogic_config */
index d3a7b0c3d38bf01b8ed8edc785b3aae32c4f5c8c..fe3cde0da84afe6228790f368de6520b29a60a71 100644 (file)
@@ -229,10 +229,7 @@ static void ixj_cs_release(dev_link_t *link)
        ixj_info_t *info = link->priv;
        DEBUG(0, "ixj_cs_release(0x%p)\n", link);
        info->ndev = 0;
-       link->dev = NULL;
-       pcmcia_release_configuration(link->handle);
-       pcmcia_release_io(link->handle, &link->io);
-       link->state &= ~DEV_CONFIG;
+       pcmcia_disable_device(link->handle);
 }
 
 static int ixj_suspend(struct pcmcia_device *dev)
index 134d2000128a557778f604cc3cba78130cc272db..ee811673d903138177fe7218b5d684b09a542842 100644 (file)
@@ -154,19 +154,10 @@ static void sl811_cs_detach(struct pcmcia_device *p_dev)
 
 static void sl811_cs_release(dev_link_t * link)
 {
-
        DBG(0, "sl811_cs_release(0x%p)\n", link);
 
-       /* Unlink the device chain */
-       link->dev = NULL;
-
+       pcmcia_disable_device(link->handle);
        platform_device_unregister(&platform_dev);
-       pcmcia_release_configuration(link->handle);
-       if (link->io.NumPorts1)
-               pcmcia_release_io(link->handle, &link->io);
-       if (link->irq.AssignedIRQ)
-               pcmcia_release_irq(link->handle, &link->irq);
-       link->state &= ~DEV_CONFIG;
 }
 
 static void sl811_cs_config(dev_link_t *link)
@@ -260,8 +251,7 @@ static void sl811_cs_config(dev_link_t *link)
                break;
 
 next_entry:
-               if (link->io.NumPorts1)
-                       pcmcia_release_io(link->handle, &link->io);
+               pcmcia_disable_device(handle);
                last_ret = pcmcia_get_next_tuple(handle, &tuple);
        }
 
index a5d8df24d56c20f092bf682584e30d3e13a810d6..7b915200c116511a643336fc748a619018a1a0d9 100644 (file)
@@ -379,8 +379,6 @@ int pcmcia_get_mem_page(window_handle_t win, memreq_t *req);
 int pcmcia_map_mem_page(window_handle_t win, memreq_t *req);
 int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod);
 int pcmcia_release_configuration(struct pcmcia_device *p_dev);
-int pcmcia_release_io(struct pcmcia_device *p_dev, io_req_t *req);
-int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req);
 int pcmcia_release_window(window_handle_t win);
 int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req);
 int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req);
index a2d3eb47f83c8839c66717760d9de1a5f03cdd41..80c53553b8153da64dd6da2a41eb907d92a9ffff 100644 (file)
@@ -273,9 +273,7 @@ static void pdacf_config(dev_link_t *link)
 cs_failed:
        cs_error(link->handle, last_fn, last_ret);
 failed:
-       pcmcia_release_configuration(link->handle);
-       pcmcia_release_io(link->handle, &link->io);
-       pcmcia_release_irq(link->handle, &link->irq);
+       pcmcia_disable_device(link->handle);
 }
 
 #ifdef CONFIG_PM
index 92788744bc48309f7b6e5c86628fc3031869d2ef..8093e5044956e0d6068169d628ddc4bef3907922 100644 (file)
@@ -272,10 +272,7 @@ static void vxpocket_config(dev_link_t *link)
 cs_failed:
        cs_error(link->handle, last_fn, last_ret);
 failed:
-       pcmcia_release_configuration(link->handle);
-       pcmcia_release_io(link->handle, &link->io);
-       pcmcia_release_irq(link->handle, &link->irq);
-       link->state &= ~DEV_CONFIG;
+       pcmcia_disable_device(link->handle);
        kfree(parse);
 }