From e2d4096365e06b9a3799afbadc28b4519c0b3526 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Thu, 2 Mar 2006 00:09:29 +0100 Subject: [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 --- drivers/isdn/hardware/avm/avm_cs.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'drivers/isdn/hardware') diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c index 28f9211726c5..7bbfd85ab793 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); -- cgit v1.2.3