aboutsummaryrefslogtreecommitdiff
path: root/drivers/bluetooth/bt3c_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-02 00:09:29 +0100
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 17:26:33 +0200
commite2d4096365e06b9a3799afbadc28b4519c0b3526 (patch)
tree90ec691d71f9c0309048714e359b8ba351b533f7 /drivers/bluetooth/bt3c_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/bluetooth/bt3c_cs.c')
-rw-r--r--drivers/bluetooth/bt3c_cs.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index 80861f4f35e3..b94ac2f9f7ba 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -195,7 +195,7 @@ static void bt3c_write_wakeup(bt3c_info_t *info)
register struct sk_buff *skb;
register int len;
- if (!(info->p_dev->state & DEV_PRESENT))
+ if (!pcmcia_dev_present(info->p_dev))
break;
@@ -668,7 +668,6 @@ static int bt3c_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 bt3c_config(link);
}
@@ -677,9 +676,7 @@ static void bt3c_detach(struct pcmcia_device *link)
{
bt3c_info_t *info = link->priv;
- if (link->state & DEV_CONFIG)
- bt3c_release(link);
-
+ bt3c_release(link);
kfree(info);
}
@@ -733,9 +730,6 @@ static int bt3c_config(struct pcmcia_device *link)
link->conf.ConfigBase = parse.config.base;
link->conf.Present = parse.config.rmask[0];
- /* Configure card */
- link->state |= DEV_CONFIG;
-
/* First pass: look for a config entry that looks normal. */
tuple.TupleData = (cisdata_t *)buf;
tuple.TupleOffset = 0;
@@ -805,7 +799,6 @@ found_port:
strcpy(info->node.dev_name, info->hdev->name);
link->dev_node = &info->node;
- link->state &= ~DEV_CONFIG_PENDING;
return 0;
@@ -822,8 +815,7 @@ static void bt3c_release(struct pcmcia_device *link)
{
bt3c_info_t *info = link->priv;
- if (link->state & DEV_PRESENT)
- bt3c_close(info);
+ bt3c_close(info);
pcmcia_disable_device(link);
}