[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>
This commit is contained in:
Dominik Brodowski
2006-01-15 09:32:39 +01:00
parent 1de9cedfbd
commit 5f2a71fcb7
43 changed files with 153 additions and 401 deletions

View File

@@ -418,23 +418,14 @@ static void atmel_config(dev_link_t *link)
static void atmel_release(dev_link_t *link)
{
struct net_device *dev = ((local_info_t*)link->priv)->eth_dev;
DEBUG(0, "atmel_release(0x%p)\n", link);
/* Unlink the device chain */
link->dev = NULL;
if (dev)
if (dev)
stop_atmel_card(dev);
((local_info_t*)link->priv)->eth_dev = NULL;
/* Don't bother checking to see if these succeed or not */
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;
((local_info_t*)link->priv)->eth_dev = NULL;
pcmcia_disable_device(link->handle);
}
static int atmel_suspend(struct pcmcia_device *dev)