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/telephony/ixj_pcmcia.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/telephony/ixj_pcmcia.c')
-rw-r--r-- | drivers/telephony/ixj_pcmcia.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/telephony/ixj_pcmcia.c b/drivers/telephony/ixj_pcmcia.c index 5c7611c2ac6c..dda0ca45d904 100644 --- a/drivers/telephony/ixj_pcmcia.c +++ b/drivers/telephony/ixj_pcmcia.c | |||
@@ -52,7 +52,6 @@ static int ixj_probe(struct pcmcia_device *p_dev) | |||
52 | } | 52 | } |
53 | memset(p_dev->priv, 0, sizeof(struct ixj_info_t)); | 53 | memset(p_dev->priv, 0, sizeof(struct ixj_info_t)); |
54 | 54 | ||
55 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | ||
56 | return ixj_config(p_dev); | 55 | return ixj_config(p_dev); |
57 | } | 56 | } |
58 | 57 | ||
@@ -60,8 +59,7 @@ static void ixj_detach(struct pcmcia_device *link) | |||
60 | { | 59 | { |
61 | DEBUG(0, "ixj_detach(0x%p)\n", link); | 60 | DEBUG(0, "ixj_detach(0x%p)\n", link); |
62 | 61 | ||
63 | if (link->state & DEV_CONFIG) | 62 | ixj_cs_release(link); |
64 | ixj_cs_release(link); | ||
65 | 63 | ||
66 | kfree(link->priv); | 64 | kfree(link->priv); |
67 | } | 65 | } |
@@ -155,7 +153,6 @@ static int ixj_config(struct pcmcia_device * link) | |||
155 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); | 153 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); |
156 | link->conf.ConfigBase = parse.config.base; | 154 | link->conf.ConfigBase = parse.config.base; |
157 | link->conf.Present = parse.config.rmask[0]; | 155 | link->conf.Present = parse.config.rmask[0]; |
158 | link->state |= DEV_CONFIG; | ||
159 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 156 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
160 | tuple.Attributes = 0; | 157 | tuple.Attributes = 0; |
161 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | 158 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
@@ -194,7 +191,6 @@ static int ixj_config(struct pcmcia_device * link) | |||
194 | info->node.major = PHONE_MAJOR; | 191 | info->node.major = PHONE_MAJOR; |
195 | link->dev_node = &info->node; | 192 | link->dev_node = &info->node; |
196 | ixj_get_serial(link, j); | 193 | ixj_get_serial(link, j); |
197 | link->state &= ~DEV_CONFIG_PENDING; | ||
198 | return 0; | 194 | return 0; |
199 | cs_failed: | 195 | cs_failed: |
200 | cs_error(link, last_fn, last_ret); | 196 | cs_error(link, last_fn, last_ret); |