[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/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
index 7caa700..ee449b2 100644
--- a/drivers/scsi/pcmcia/aha152x_stub.c
+++ b/drivers/scsi/pcmcia/aha152x_stub.c
@@ -122,7 +122,6 @@
link->conf.IntType = INT_MEMORY_AND_IO;
link->conf.Present = PRESENT_OPTION;
- link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
return aha152x_config_cs(link);
} /* aha152x_attach */
@@ -132,8 +131,7 @@
{
DEBUG(0, "aha152x_detach(0x%p)\n", link);
- if (link->state & DEV_CONFIG)
- aha152x_release_cs(link);
+ aha152x_release_cs(link);
/* Unlink device structure, free bits */
kfree(link->priv);
@@ -165,9 +163,6 @@
CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
link->conf.ConfigBase = parse.config.base;
- /* Configure card */
- link->state |= DEV_CONFIG;
-
tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
while (1) {
@@ -216,7 +211,6 @@
link->dev_node = &info->node;
info->host = host;
- link->state &= ~DEV_CONFIG_PENDING;
return 0;
cs_failed: