summaryrefslogtreecommitdiff
path: root/drivers/char/pcmcia
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-01-15 09:32:39 +0100
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 17:15:50 +0200
commit5f2a71fcb7995633b335a1e380ac63a968e61320 (patch)
treed47f4227d314fc9f298b75c217fa78440004e6e7 /drivers/char/pcmcia
parent1de9cedfbdff1d8adb662cd3afc5bda66e393351 (diff)
downloadlinux-3.10-5f2a71fcb7995633b335a1e380ac63a968e61320.tar.gz
linux-3.10-5f2a71fcb7995633b335a1e380ac63a968e61320.tar.bz2
linux-3.10-5f2a71fcb7995633b335a1e380ac63a968e61320.zip
[PATCH] pcmcia: add pcmcia_disable_device
pcmcia_disable_device(struct pcmcia_device *p_dev) performs the necessary cleanups upon device or driver removal: it calls the appropriate pcmcia_release_* functions, and can replace (most) of the current drivers' _release() functions. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/char/pcmcia')
-rw-r--r--drivers/char/pcmcia/cm4000_cs.c3
-rw-r--r--drivers/char/pcmcia/cm4040_cs.c3
-rw-r--r--drivers/char/pcmcia/synclink_cs.c10
3 files changed, 3 insertions, 13 deletions
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c
index 5fdf1851543..3ddd3da9e72 100644
--- a/drivers/char/pcmcia/cm4000_cs.c
+++ b/drivers/char/pcmcia/cm4000_cs.c
@@ -1899,8 +1899,7 @@ static int cm4000_resume(struct pcmcia_device *p_dev)
static void cm4000_release(dev_link_t *link)
{
cmm_cm4000_release(link->priv); /* delay release until device closed */
- pcmcia_release_configuration(link->handle);
- pcmcia_release_io(link->handle, &link->io);
+ pcmcia_disable_device(link->handle);
}
static int cm4000_attach(struct pcmcia_device *p_dev)
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c
index 466e33bab02..1c355bd2be8 100644
--- a/drivers/char/pcmcia/cm4040_cs.c
+++ b/drivers/char/pcmcia/cm4040_cs.c
@@ -654,8 +654,7 @@ static int reader_resume(struct pcmcia_device *p_dev)
static void reader_release(dev_link_t *link)
{
cm4040_reader_release(link->priv);
- pcmcia_release_configuration(link->handle);
- pcmcia_release_io(link->handle, &link->io);
+ pcmcia_disable_device(link->handle);
}
static int reader_attach(struct pcmcia_device *p_dev)
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index e6b714b6390..371d10b7800 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -710,15 +710,7 @@ static void mgslpc_release(u_long arg)
if (debug_level >= DEBUG_LEVEL_INFO)
printk("mgslpc_release(0x%p)\n", link);
- /* Unlink the device chain */
- link->dev = NULL;
- link->state &= ~DEV_CONFIG;
-
- 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);
+ pcmcia_disable_device(link->handle);
}
static void mgslpc_detach(struct pcmcia_device *p_dev)