aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hisax/sedlbauer_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/sedlbauer_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/sedlbauer_cs.c')
-rw-r--r--drivers/isdn/hisax/sedlbauer_cs.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c
index a35a29586a62..9bb18f3f7829 100644
--- a/drivers/isdn/hisax/sedlbauer_cs.c
+++ b/drivers/isdn/hisax/sedlbauer_cs.c
@@ -186,7 +186,6 @@ static int sedlbauer_probe(struct pcmcia_device *link)
186 link->conf.Attributes = 0; 186 link->conf.Attributes = 0;
187 link->conf.IntType = INT_MEMORY_AND_IO; 187 link->conf.IntType = INT_MEMORY_AND_IO;
188 188
189 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
190 return sedlbauer_config(link); 189 return sedlbauer_config(link);
191} /* sedlbauer_attach */ 190} /* sedlbauer_attach */
192 191
@@ -201,15 +200,13 @@ static int sedlbauer_probe(struct pcmcia_device *link)
201 200
202static void sedlbauer_detach(struct pcmcia_device *link) 201static void sedlbauer_detach(struct pcmcia_device *link)
203{ 202{
204 DEBUG(0, "sedlbauer_detach(0x%p)\n", link); 203 DEBUG(0, "sedlbauer_detach(0x%p)\n", link);
205 204
206 if (link->state & DEV_CONFIG) { 205 ((local_info_t *)link->priv)->stop = 1;
207 ((local_info_t *)link->priv)->stop = 1; 206 sedlbauer_release(link);
208 sedlbauer_release(link);
209 }
210 207
211 /* This points to the parent local_info_t struct */ 208 /* This points to the parent local_info_t struct */
212 kfree(link->priv); 209 kfree(link->priv);
213} /* sedlbauer_detach */ 210} /* sedlbauer_detach */
214 211
215/*====================================================================== 212/*======================================================================
@@ -250,9 +247,6 @@ static int sedlbauer_config(struct pcmcia_device *link)
250 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 247 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
251 link->conf.ConfigBase = parse.config.base; 248 link->conf.ConfigBase = parse.config.base;
252 link->conf.Present = parse.config.rmask[0]; 249 link->conf.Present = parse.config.rmask[0];
253
254 /* Configure card */
255 link->state |= DEV_CONFIG;
256 250
257 CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &conf)); 251 CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &conf));
258 252
@@ -408,8 +402,6 @@ static int sedlbauer_config(struct pcmcia_device *link)
408 printk(", mem 0x%06lx-0x%06lx", req.Base, 402 printk(", mem 0x%06lx-0x%06lx", req.Base,
409 req.Base+req.Size-1); 403 req.Base+req.Size-1);
410 printk("\n"); 404 printk("\n");
411
412 link->state &= ~DEV_CONFIG_PENDING;
413 405
414 icard.para[0] = link->irq.AssignedIRQ; 406 icard.para[0] = link->irq.AssignedIRQ;
415 icard.para[1] = link->io.BasePort1; 407 icard.para[1] = link->io.BasePort1;