diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-01 18:09:29 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:26:33 -0500 |
commit | e2d4096365e06b9a3799afbadc28b4519c0b3526 (patch) | |
tree | 90ec691d71f9c0309048714e359b8ba351b533f7 /drivers/usb/host/sl811_cs.c | |
parent | f6fbe01ac976f3ec618cd5fb71ad9ce2cfa7ab2b (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/usb/host/sl811_cs.c')
-rw-r--r-- | drivers/usb/host/sl811_cs.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/usb/host/sl811_cs.c b/drivers/usb/host/sl811_cs.c index e8b8e9a93084..302aa1ec312f 100644 --- a/drivers/usb/host/sl811_cs.c +++ b/drivers/usb/host/sl811_cs.c | |||
@@ -142,9 +142,7 @@ static void sl811_cs_detach(struct pcmcia_device *link) | |||
142 | { | 142 | { |
143 | DBG(0, "sl811_cs_detach(0x%p)\n", link); | 143 | DBG(0, "sl811_cs_detach(0x%p)\n", link); |
144 | 144 | ||
145 | link->state &= ~DEV_PRESENT; | 145 | sl811_cs_release(link); |
146 | if (link->state & DEV_CONFIG) | ||
147 | sl811_cs_release(link); | ||
148 | 146 | ||
149 | /* This points to the parent local_info_t struct */ | 147 | /* This points to the parent local_info_t struct */ |
150 | kfree(link->priv); | 148 | kfree(link->priv); |
@@ -182,9 +180,6 @@ static int sl811_cs_config(struct pcmcia_device *link) | |||
182 | link->conf.ConfigBase = parse.config.base; | 180 | link->conf.ConfigBase = parse.config.base; |
183 | link->conf.Present = parse.config.rmask[0]; | 181 | link->conf.Present = parse.config.rmask[0]; |
184 | 182 | ||
185 | /* Configure card */ | ||
186 | link->state |= DEV_CONFIG; | ||
187 | |||
188 | /* Look up the current Vcc */ | 183 | /* Look up the current Vcc */ |
189 | CS_CHECK(GetConfigurationInfo, | 184 | CS_CHECK(GetConfigurationInfo, |
190 | pcmcia_get_configuration_info(link, &conf)); | 185 | pcmcia_get_configuration_info(link, &conf)); |
@@ -276,15 +271,12 @@ next_entry: | |||
276 | link->io.BasePort1+link->io.NumPorts1-1); | 271 | link->io.BasePort1+link->io.NumPorts1-1); |
277 | printk("\n"); | 272 | printk("\n"); |
278 | 273 | ||
279 | link->state &= ~DEV_CONFIG_PENDING; | ||
280 | |||
281 | if (sl811_hc_init(parent, link->io.BasePort1, link->irq.AssignedIRQ) | 274 | if (sl811_hc_init(parent, link->io.BasePort1, link->irq.AssignedIRQ) |
282 | < 0) { | 275 | < 0) { |
283 | cs_failed: | 276 | cs_failed: |
284 | printk("sl811_cs_config failed\n"); | 277 | printk("sl811_cs_config failed\n"); |
285 | cs_error(link, last_fn, last_ret); | 278 | cs_error(link, last_fn, last_ret); |
286 | sl811_cs_release(link); | 279 | sl811_cs_release(link); |
287 | link->state &= ~DEV_CONFIG_PENDING; | ||
288 | return -ENODEV; | 280 | return -ENODEV; |
289 | } | 281 | } |
290 | return 0; | 282 | return 0; |
@@ -309,7 +301,6 @@ static int sl811_cs_probe(struct pcmcia_device *link) | |||
309 | link->conf.Attributes = 0; | 301 | link->conf.Attributes = 0; |
310 | link->conf.IntType = INT_MEMORY_AND_IO; | 302 | link->conf.IntType = INT_MEMORY_AND_IO; |
311 | 303 | ||
312 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | ||
313 | return sl811_cs_config(link); | 304 | return sl811_cs_config(link); |
314 | } | 305 | } |
315 | 306 | ||