summaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hardware
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-02 00:09:29 +0100
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 17:26:33 +0200
commite2d4096365e06b9a3799afbadc28b4519c0b3526 (patch)
tree90ec691d71f9c0309048714e359b8ba351b533f7 /drivers/isdn/hardware
parentf6fbe01ac976f3ec618cd5fb71ad9ce2cfa7ab2b (diff)
[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>
Diffstat (limited to 'drivers/isdn/hardware')
-rw-r--r--drivers/isdn/hardware/avm/avm_cs.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c
index 28f9211726c..7bbfd85ab79 100644
--- a/drivers/isdn/hardware/avm/avm_cs.c
+++ b/drivers/isdn/hardware/avm/avm_cs.c
@@ -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);