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/isdn/hardware | |
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/isdn/hardware')
-rw-r--r-- | drivers/isdn/hardware/avm/avm_cs.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c index 28f9211726c5..7bbfd85ab793 100644 --- a/drivers/isdn/hardware/avm/avm_cs.c +++ b/drivers/isdn/hardware/avm/avm_cs.c | |||
@@ -127,7 +127,6 @@ static int avmcs_probe(struct pcmcia_device *p_dev) | |||
127 | memset(local, 0, sizeof(local_info_t)); | 127 | memset(local, 0, sizeof(local_info_t)); |
128 | p_dev->priv = local; | 128 | p_dev->priv = local; |
129 | 129 | ||
130 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | ||
131 | return avmcs_config(p_dev); | 130 | return avmcs_config(p_dev); |
132 | 131 | ||
133 | err: | 132 | err: |
@@ -145,10 +144,8 @@ static int avmcs_probe(struct pcmcia_device *p_dev) | |||
145 | 144 | ||
146 | static void avmcs_detach(struct pcmcia_device *link) | 145 | static void avmcs_detach(struct pcmcia_device *link) |
147 | { | 146 | { |
148 | if (link->state & DEV_CONFIG) | ||
149 | avmcs_release(link); | 147 | avmcs_release(link); |
150 | 148 | kfree(link->priv); | |
151 | kfree(link->priv); | ||
152 | } /* avmcs_detach */ | 149 | } /* avmcs_detach */ |
153 | 150 | ||
154 | /*====================================================================== | 151 | /*====================================================================== |
@@ -216,12 +213,8 @@ static int avmcs_config(struct pcmcia_device *link) | |||
216 | } while (0); | 213 | } while (0); |
217 | if (i != CS_SUCCESS) { | 214 | if (i != CS_SUCCESS) { |
218 | cs_error(link, ParseTuple, i); | 215 | cs_error(link, ParseTuple, i); |
219 | link->state &= ~DEV_CONFIG_PENDING; | ||
220 | return -ENODEV; | 216 | return -ENODEV; |
221 | } | 217 | } |
222 | |||
223 | /* Configure card */ | ||
224 | link->state |= DEV_CONFIG; | ||
225 | 218 | ||
226 | do { | 219 | do { |
227 | 220 | ||
@@ -312,8 +305,7 @@ found_port: | |||
312 | dev->node.major = 64; | 305 | dev->node.major = 64; |
313 | dev->node.minor = 0; | 306 | dev->node.minor = 0; |
314 | link->dev_node = &dev->node; | 307 | link->dev_node = &dev->node; |
315 | 308 | ||
316 | link->state &= ~DEV_CONFIG_PENDING; | ||
317 | /* If any step failed, release any partially configured state */ | 309 | /* If any step failed, release any partially configured state */ |
318 | if (i != 0) { | 310 | if (i != 0) { |
319 | avmcs_release(link); | 311 | avmcs_release(link); |