[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>

diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c
index 11c7c4f..ac28e32 100644
--- a/drivers/isdn/hisax/avma1_cs.c
+++ b/drivers/isdn/hisax/avma1_cs.c
@@ -149,7 +149,6 @@
     p_dev->conf.ConfigIndex = 1;
     p_dev->conf.Present = PRESENT_OPTION;
 
-    p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
     return avma1cs_config(p_dev);
 } /* avma1cs_attach */
 
@@ -164,12 +163,9 @@
 
 static void avma1cs_detach(struct pcmcia_device *link)
 {
-    DEBUG(0, "avma1cs_detach(0x%p)\n", link);
-
-    if (link->state & DEV_CONFIG)
-	    avma1cs_release(link);
-
-    kfree(link->priv);
+	DEBUG(0, "avma1cs_detach(0x%p)\n", link);
+	avma1cs_release(link);
+	kfree(link->priv);
 } /* avma1cs_detach */
 
 /*======================================================================
@@ -239,12 +235,8 @@
     } 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 {
 
@@ -318,8 +310,7 @@
     dev->node.major = 45;
     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) {
 	avma1cs_release(link);