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/bluecard_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/bluecard_cs.c')
-rw-r--r-- | drivers/bluetooth/bluecard_cs.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c index 50174fb107a8..473a13b22b29 100644 --- a/drivers/bluetooth/bluecard_cs.c +++ b/drivers/bluetooth/bluecard_cs.c | |||
@@ -244,7 +244,7 @@ static void bluecard_write_wakeup(bluecard_info_t *info) | |||
244 | 244 | ||
245 | clear_bit(XMIT_WAKEUP, &(info->tx_state)); | 245 | clear_bit(XMIT_WAKEUP, &(info->tx_state)); |
246 | 246 | ||
247 | if (!(info->p_dev->state & DEV_PRESENT)) | 247 | if (!pcmcia_dev_present(info->p_dev)) |
248 | return; | 248 | return; |
249 | 249 | ||
250 | if (test_bit(XMIT_BUFFER_NUMBER, &(info->tx_state))) { | 250 | if (test_bit(XMIT_BUFFER_NUMBER, &(info->tx_state))) { |
@@ -879,7 +879,6 @@ static int bluecard_probe(struct pcmcia_device *link) | |||
879 | link->conf.Attributes = CONF_ENABLE_IRQ; | 879 | link->conf.Attributes = CONF_ENABLE_IRQ; |
880 | link->conf.IntType = INT_MEMORY_AND_IO; | 880 | link->conf.IntType = INT_MEMORY_AND_IO; |
881 | 881 | ||
882 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | ||
883 | return bluecard_config(link); | 882 | return bluecard_config(link); |
884 | } | 883 | } |
885 | 884 | ||
@@ -888,9 +887,7 @@ static void bluecard_detach(struct pcmcia_device *link) | |||
888 | { | 887 | { |
889 | bluecard_info_t *info = link->priv; | 888 | bluecard_info_t *info = link->priv; |
890 | 889 | ||
891 | if (link->state & DEV_CONFIG) | 890 | bluecard_release(link); |
892 | bluecard_release(link); | ||
893 | |||
894 | kfree(info); | 891 | kfree(info); |
895 | } | 892 | } |
896 | 893 | ||
@@ -933,9 +930,6 @@ static int bluecard_config(struct pcmcia_device *link) | |||
933 | link->conf.ConfigBase = parse.config.base; | 930 | link->conf.ConfigBase = parse.config.base; |
934 | link->conf.Present = parse.config.rmask[0]; | 931 | link->conf.Present = parse.config.rmask[0]; |
935 | 932 | ||
936 | /* Configure card */ | ||
937 | link->state |= DEV_CONFIG; | ||
938 | |||
939 | link->conf.ConfigIndex = 0x20; | 933 | link->conf.ConfigIndex = 0x20; |
940 | link->io.NumPorts1 = 64; | 934 | link->io.NumPorts1 = 64; |
941 | link->io.IOAddrLines = 6; | 935 | link->io.IOAddrLines = 6; |
@@ -969,7 +963,6 @@ static int bluecard_config(struct pcmcia_device *link) | |||
969 | 963 | ||
970 | strcpy(info->node.dev_name, info->hdev->name); | 964 | strcpy(info->node.dev_name, info->hdev->name); |
971 | link->dev_node = &info->node; | 965 | link->dev_node = &info->node; |
972 | link->state &= ~DEV_CONFIG_PENDING; | ||
973 | 966 | ||
974 | return 0; | 967 | return 0; |
975 | 968 | ||
@@ -986,8 +979,7 @@ static void bluecard_release(struct pcmcia_device *link) | |||
986 | { | 979 | { |
987 | bluecard_info_t *info = link->priv; | 980 | bluecard_info_t *info = link->priv; |
988 | 981 | ||
989 | if (link->state & DEV_PRESENT) | 982 | bluecard_close(info); |
990 | bluecard_close(info); | ||
991 | 983 | ||
992 | del_timer(&(info->timer)); | 984 | del_timer(&(info->timer)); |
993 | 985 | ||