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/bt3c_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/bt3c_cs.c')
-rw-r--r-- | drivers/bluetooth/bt3c_cs.c | 14 |
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) | |||
195 | register struct sk_buff *skb; | 195 | register struct sk_buff *skb; |
196 | register int len; | 196 | register int len; |
197 | 197 | ||
198 | if (!(info->p_dev->state & DEV_PRESENT)) | 198 | if (!pcmcia_dev_present(info->p_dev)) |
199 | break; | 199 | break; |
200 | 200 | ||
201 | 201 | ||
@@ -668,7 +668,6 @@ static int bt3c_probe(struct pcmcia_device *link) | |||
668 | link->conf.Attributes = CONF_ENABLE_IRQ; | 668 | link->conf.Attributes = CONF_ENABLE_IRQ; |
669 | link->conf.IntType = INT_MEMORY_AND_IO; | 669 | link->conf.IntType = INT_MEMORY_AND_IO; |
670 | 670 | ||
671 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | ||
672 | return bt3c_config(link); | 671 | return bt3c_config(link); |
673 | } | 672 | } |
674 | 673 | ||
@@ -677,9 +676,7 @@ static void bt3c_detach(struct pcmcia_device *link) | |||
677 | { | 676 | { |
678 | bt3c_info_t *info = link->priv; | 677 | bt3c_info_t *info = link->priv; |
679 | 678 | ||
680 | if (link->state & DEV_CONFIG) | 679 | bt3c_release(link); |
681 | bt3c_release(link); | ||
682 | |||
683 | kfree(info); | 680 | kfree(info); |
684 | } | 681 | } |
685 | 682 | ||
@@ -733,9 +730,6 @@ static int bt3c_config(struct pcmcia_device *link) | |||
733 | link->conf.ConfigBase = parse.config.base; | 730 | link->conf.ConfigBase = parse.config.base; |
734 | link->conf.Present = parse.config.rmask[0]; | 731 | link->conf.Present = parse.config.rmask[0]; |
735 | 732 | ||
736 | /* Configure card */ | ||
737 | link->state |= DEV_CONFIG; | ||
738 | |||
739 | /* First pass: look for a config entry that looks normal. */ | 733 | /* First pass: look for a config entry that looks normal. */ |
740 | tuple.TupleData = (cisdata_t *)buf; | 734 | tuple.TupleData = (cisdata_t *)buf; |
741 | tuple.TupleOffset = 0; | 735 | tuple.TupleOffset = 0; |
@@ -805,7 +799,6 @@ found_port: | |||
805 | 799 | ||
806 | strcpy(info->node.dev_name, info->hdev->name); | 800 | strcpy(info->node.dev_name, info->hdev->name); |
807 | link->dev_node = &info->node; | 801 | link->dev_node = &info->node; |
808 | link->state &= ~DEV_CONFIG_PENDING; | ||
809 | 802 | ||
810 | return 0; | 803 | return 0; |
811 | 804 | ||
@@ -822,8 +815,7 @@ static void bt3c_release(struct pcmcia_device *link) | |||
822 | { | 815 | { |
823 | bt3c_info_t *info = link->priv; | 816 | bt3c_info_t *info = link->priv; |
824 | 817 | ||
825 | if (link->state & DEV_PRESENT) | 818 | bt3c_close(info); |
826 | bt3c_close(info); | ||
827 | 819 | ||
828 | pcmcia_disable_device(link); | 820 | pcmcia_disable_device(link); |
829 | } | 821 | } |