[PATCH] pcmcia: use bitfield instead of p_state and state

Instead of the two status values struct pcmcia_device->p_state and state,
use descriptive bitfields. Most value-checking in drivers was invalid, as
the core now only calls the ->remove() (a.k.a. detach) function in case the
attachement _and_ configuration was successful.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This commit is contained in:
Dominik Brodowski
2006-03-02 00:09:29 +01:00
parent f6fbe01ac9
commit e2d4096365
49 changed files with 337 additions and 684 deletions

View File

@@ -127,7 +127,6 @@ static int avmcs_probe(struct pcmcia_device *p_dev)
memset(local, 0, sizeof(local_info_t));
p_dev->priv = local;
p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
return avmcs_config(p_dev);
err:
@@ -145,10 +144,8 @@ static int avmcs_probe(struct pcmcia_device *p_dev)
static void avmcs_detach(struct pcmcia_device *link)
{
if (link->state & DEV_CONFIG)
avmcs_release(link);
kfree(link->priv);
kfree(link->priv);
} /* avmcs_detach */
/*======================================================================
@@ -216,12 +213,8 @@ static int avmcs_config(struct pcmcia_device *link)
} while (0);
if (i != CS_SUCCESS) {
cs_error(link, ParseTuple, i);
link->state &= ~DEV_CONFIG_PENDING;
return -ENODEV;
}
/* Configure card */
link->state |= DEV_CONFIG;
do {
@@ -312,8 +305,7 @@ found_port:
dev->node.major = 64;
dev->node.minor = 0;
link->dev_node = &dev->node;
link->state &= ~DEV_CONFIG_PENDING;
/* If any step failed, release any partially configured state */
if (i != 0) {
avmcs_release(link);