diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-02 02:09:29 +0300 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 19:26:33 +0400 |
commit | e2d4096365e06b9a3799afbadc28b4519c0b3526 (patch) | |
tree | 90ec691d71f9c0309048714e359b8ba351b533f7 /drivers/isdn/hisax/elsa_cs.c | |
parent | f6fbe01ac976f3ec618cd5fb71ad9ce2cfa7ab2b (diff) | |
download | linux-e2d4096365e06b9a3799afbadc28b4519c0b3526.tar.xz |
[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.c | 19 |
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) link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.IntType = INT_MEMORY_AND_IO; - link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; return elsa_cs_config(link); } /* elsa_cs_attach */ @@ -189,17 +188,14 @@ static int elsa_cs_probe(struct pcmcia_device *link) static void elsa_cs_detach(struct pcmcia_device *link) { - local_info_t *info = link->priv; + local_info_t *info = link->priv; - DEBUG(0, "elsa_cs_detach(0x%p)\n", link); + DEBUG(0, "elsa_cs_detach(0x%p)\n", link); - if (link->state & DEV_CONFIG) { - info->busy = 1; - elsa_cs_release(link); - } - - kfree(info); + info->busy = 1; + elsa_cs_release(link); + kfree(info); } /* elsa_cs_detach */ /*====================================================================== @@ -263,9 +259,6 @@ static int elsa_cs_config(struct pcmcia_device *link) link->conf.ConfigBase = parse.config.base; link->conf.Present = parse.config.rmask[0]; - /* Configure card */ - link->state |= DEV_CONFIG; - tuple.TupleData = (cisdata_t *)buf; tuple.TupleOffset = 0; tuple.TupleDataMax = 255; tuple.Attributes = 0; @@ -329,8 +322,6 @@ static int elsa_cs_config(struct pcmcia_device *link) link->io.BasePort2+link->io.NumPorts2-1); printk("\n"); - link->state &= ~DEV_CONFIG_PENDING; - icard.para[0] = link->irq.AssignedIRQ; icard.para[1] = link->io.BasePort1; icard.protocol = protocol; |