aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia/aha152x_stub.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-01 18:09:29 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:26:33 -0500
commite2d4096365e06b9a3799afbadc28b4519c0b3526 (patch)
tree90ec691d71f9c0309048714e359b8ba351b533f7 /drivers/scsi/pcmcia/aha152x_stub.c
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/scsi/pcmcia/aha152x_stub.c')
-rw-r--r--drivers/scsi/pcmcia/aha152x_stub.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
index 7caa700cf189..ee449b29fc82 100644
--- a/drivers/scsi/pcmcia/aha152x_stub.c
+++ b/drivers/scsi/pcmcia/aha152x_stub.c
@@ -122,7 +122,6 @@ static int aha152x_probe(struct pcmcia_device *link)
122 link->conf.IntType = INT_MEMORY_AND_IO; 122 link->conf.IntType = INT_MEMORY_AND_IO;
123 link->conf.Present = PRESENT_OPTION; 123 link->conf.Present = PRESENT_OPTION;
124 124
125 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
126 return aha152x_config_cs(link); 125 return aha152x_config_cs(link);
127} /* aha152x_attach */ 126} /* aha152x_attach */
128 127
@@ -132,8 +131,7 @@ static void aha152x_detach(struct pcmcia_device *link)
132{ 131{
133 DEBUG(0, "aha152x_detach(0x%p)\n", link); 132 DEBUG(0, "aha152x_detach(0x%p)\n", link);
134 133
135 if (link->state & DEV_CONFIG) 134 aha152x_release_cs(link);
136 aha152x_release_cs(link);
137 135
138 /* Unlink device structure, free bits */ 136 /* Unlink device structure, free bits */
139 kfree(link->priv); 137 kfree(link->priv);
@@ -165,9 +163,6 @@ static int aha152x_config_cs(struct pcmcia_device *link)
165 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 163 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
166 link->conf.ConfigBase = parse.config.base; 164 link->conf.ConfigBase = parse.config.base;
167 165
168 /* Configure card */
169 link->state |= DEV_CONFIG;
170
171 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 166 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
172 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 167 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
173 while (1) { 168 while (1) {
@@ -216,7 +211,6 @@ static int aha152x_config_cs(struct pcmcia_device *link)
216 link->dev_node = &info->node; 211 link->dev_node = &info->node;
217 info->host = host; 212 info->host = host;
218 213
219 link->state &= ~DEV_CONFIG_PENDING;
220 return 0; 214 return 0;
221 215
222cs_failed: 216cs_failed: