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/bluetooth/btuart_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/bluetooth/btuart_cs.c')
-rw-r--r-- | drivers/bluetooth/btuart_cs.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c index 658a1373699e..9ce4c93467e5 100644 --- a/drivers/bluetooth/btuart_cs.c +++ b/drivers/bluetooth/btuart_cs.c | |||
@@ -152,7 +152,7 @@ static void btuart_write_wakeup(btuart_info_t *info) | |||
152 | 152 | ||
153 | clear_bit(XMIT_WAKEUP, &(info->tx_state)); | 153 | clear_bit(XMIT_WAKEUP, &(info->tx_state)); |
154 | 154 | ||
155 | if (!(info->p_dev->state & DEV_PRESENT)) | 155 | if (!pcmcia_dev_present(info->p_dev)) |
156 | return; | 156 | return; |
157 | 157 | ||
158 | if (!(skb = skb_dequeue(&(info->txq)))) | 158 | if (!(skb = skb_dequeue(&(info->txq)))) |
@@ -599,7 +599,6 @@ static int btuart_probe(struct pcmcia_device *link) | |||
599 | link->conf.Attributes = CONF_ENABLE_IRQ; | 599 | link->conf.Attributes = CONF_ENABLE_IRQ; |
600 | link->conf.IntType = INT_MEMORY_AND_IO; | 600 | link->conf.IntType = INT_MEMORY_AND_IO; |
601 | 601 | ||
602 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | ||
603 | return btuart_config(link); | 602 | return btuart_config(link); |
604 | } | 603 | } |
605 | 604 | ||
@@ -608,9 +607,7 @@ static void btuart_detach(struct pcmcia_device *link) | |||
608 | { | 607 | { |
609 | btuart_info_t *info = link->priv; | 608 | btuart_info_t *info = link->priv; |
610 | 609 | ||
611 | if (link->state & DEV_CONFIG) | 610 | btuart_release(link); |
612 | btuart_release(link); | ||
613 | |||
614 | kfree(info); | 611 | kfree(info); |
615 | } | 612 | } |
616 | 613 | ||
@@ -664,9 +661,6 @@ static int btuart_config(struct pcmcia_device *link) | |||
664 | link->conf.ConfigBase = parse.config.base; | 661 | link->conf.ConfigBase = parse.config.base; |
665 | link->conf.Present = parse.config.rmask[0]; | 662 | link->conf.Present = parse.config.rmask[0]; |
666 | 663 | ||
667 | /* Configure card */ | ||
668 | link->state |= DEV_CONFIG; | ||
669 | |||
670 | /* First pass: look for a config entry that looks normal. */ | 664 | /* First pass: look for a config entry that looks normal. */ |
671 | tuple.TupleData = (cisdata_t *) buf; | 665 | tuple.TupleData = (cisdata_t *) buf; |
672 | tuple.TupleOffset = 0; | 666 | tuple.TupleOffset = 0; |
@@ -737,7 +731,6 @@ found_port: | |||
737 | 731 | ||
738 | strcpy(info->node.dev_name, info->hdev->name); | 732 | strcpy(info->node.dev_name, info->hdev->name); |
739 | link->dev_node = &info->node; | 733 | link->dev_node = &info->node; |
740 | link->state &= ~DEV_CONFIG_PENDING; | ||
741 | 734 | ||
742 | return 0; | 735 | return 0; |
743 | 736 | ||
@@ -754,8 +747,7 @@ static void btuart_release(struct pcmcia_device *link) | |||
754 | { | 747 | { |
755 | btuart_info_t *info = link->priv; | 748 | btuart_info_t *info = link->priv; |
756 | 749 | ||
757 | if (link->state & DEV_PRESENT) | 750 | btuart_close(info); |
758 | btuart_close(info); | ||
759 | 751 | ||
760 | pcmcia_disable_device(link); | 752 | pcmcia_disable_device(link); |
761 | } | 753 | } |