aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hisax/elsa_cs.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/isdn/hisax/elsa_cs.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/isdn/hisax/elsa_cs.c')
-rw-r--r--drivers/isdn/hisax/elsa_cs.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c
index 4856680ce761..e18e75be8ed3 100644
--- a/drivers/isdn/hisax/elsa_cs.c
+++ b/drivers/isdn/hisax/elsa_cs.c
@@ -174,7 +174,6 @@ static int elsa_cs_probe(struct pcmcia_device *link)
174 link->conf.Attributes = CONF_ENABLE_IRQ; 174 link->conf.Attributes = CONF_ENABLE_IRQ;
175 link->conf.IntType = INT_MEMORY_AND_IO; 175 link->conf.IntType = INT_MEMORY_AND_IO;
176 176
177 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
178 return elsa_cs_config(link); 177 return elsa_cs_config(link);
179} /* elsa_cs_attach */ 178} /* elsa_cs_attach */
180 179
@@ -189,17 +188,14 @@ static int elsa_cs_probe(struct pcmcia_device *link)
189 188
190static void elsa_cs_detach(struct pcmcia_device *link) 189static void elsa_cs_detach(struct pcmcia_device *link)
191{ 190{
192 local_info_t *info = link->priv; 191 local_info_t *info = link->priv;
193 192
194 DEBUG(0, "elsa_cs_detach(0x%p)\n", link); 193 DEBUG(0, "elsa_cs_detach(0x%p)\n", link);
195 194
196 if (link->state & DEV_CONFIG) { 195 info->busy = 1;
197 info->busy = 1; 196 elsa_cs_release(link);
198 elsa_cs_release(link);
199 }
200
201 kfree(info);
202 197
198 kfree(info);
203} /* elsa_cs_detach */ 199} /* elsa_cs_detach */
204 200
205/*====================================================================== 201/*======================================================================
@@ -263,9 +259,6 @@ static int elsa_cs_config(struct pcmcia_device *link)
263 link->conf.ConfigBase = parse.config.base; 259 link->conf.ConfigBase = parse.config.base;
264 link->conf.Present = parse.config.rmask[0]; 260 link->conf.Present = parse.config.rmask[0];
265 261
266 /* Configure card */
267 link->state |= DEV_CONFIG;
268
269 tuple.TupleData = (cisdata_t *)buf; 262 tuple.TupleData = (cisdata_t *)buf;
270 tuple.TupleOffset = 0; tuple.TupleDataMax = 255; 263 tuple.TupleOffset = 0; tuple.TupleDataMax = 255;
271 tuple.Attributes = 0; 264 tuple.Attributes = 0;
@@ -329,8 +322,6 @@ static int elsa_cs_config(struct pcmcia_device *link)
329 link->io.BasePort2+link->io.NumPorts2-1); 322 link->io.BasePort2+link->io.NumPorts2-1);
330 printk("\n"); 323 printk("\n");
331 324
332 link->state &= ~DEV_CONFIG_PENDING;
333
334 icard.para[0] = link->irq.AssignedIRQ; 325 icard.para[0] = link->irq.AssignedIRQ;
335 icard.para[1] = link->io.BasePort1; 326 icard.para[1] = link->io.BasePort1;
336 icard.protocol = protocol; 327 icard.protocol = protocol;