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/net/wireless/netwave_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/net/wireless/netwave_cs.c')
-rw-r--r-- | drivers/net/wireless/netwave_cs.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c index 2689f3bbc889..fbc8595cde39 100644 --- a/drivers/net/wireless/netwave_cs.c +++ b/drivers/net/wireless/netwave_cs.c | |||
@@ -428,7 +428,6 @@ static int netwave_probe(struct pcmcia_device *link) | |||
428 | dev->stop = &netwave_close; | 428 | dev->stop = &netwave_close; |
429 | link->irq.Instance = dev; | 429 | link->irq.Instance = dev; |
430 | 430 | ||
431 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | ||
432 | return netwave_pcmcia_config( link); | 431 | return netwave_pcmcia_config( link); |
433 | } /* netwave_attach */ | 432 | } /* netwave_attach */ |
434 | 433 | ||
@@ -446,8 +445,7 @@ static void netwave_detach(struct pcmcia_device *link) | |||
446 | 445 | ||
447 | DEBUG(0, "netwave_detach(0x%p)\n", link); | 446 | DEBUG(0, "netwave_detach(0x%p)\n", link); |
448 | 447 | ||
449 | if (link->state & DEV_CONFIG) | 448 | netwave_release(link); |
450 | netwave_release(link); | ||
451 | 449 | ||
452 | if (link->dev_node) | 450 | if (link->dev_node) |
453 | unregister_netdev(dev); | 451 | unregister_netdev(dev); |
@@ -763,9 +761,6 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) { | |||
763 | link->conf.ConfigBase = parse.config.base; | 761 | link->conf.ConfigBase = parse.config.base; |
764 | link->conf.Present = parse.config.rmask[0]; | 762 | link->conf.Present = parse.config.rmask[0]; |
765 | 763 | ||
766 | /* Configure card */ | ||
767 | link->state |= DEV_CONFIG; | ||
768 | |||
769 | /* | 764 | /* |
770 | * Try allocating IO ports. This tries a few fixed addresses. | 765 | * Try allocating IO ports. This tries a few fixed addresses. |
771 | * If you want, you can also read the card's config table to | 766 | * If you want, you can also read the card's config table to |
@@ -823,7 +818,6 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) { | |||
823 | 818 | ||
824 | strcpy(priv->node.dev_name, dev->name); | 819 | strcpy(priv->node.dev_name, dev->name); |
825 | link->dev_node = &priv->node; | 820 | link->dev_node = &priv->node; |
826 | link->state &= ~DEV_CONFIG_PENDING; | ||
827 | 821 | ||
828 | /* Reset card before reading physical address */ | 822 | /* Reset card before reading physical address */ |
829 | netwave_doreset(dev->base_addr, ramBase); | 823 | netwave_doreset(dev->base_addr, ramBase); |
@@ -875,7 +869,7 @@ static int netwave_suspend(struct pcmcia_device *link) | |||
875 | { | 869 | { |
876 | struct net_device *dev = link->priv; | 870 | struct net_device *dev = link->priv; |
877 | 871 | ||
878 | if ((link->state & DEV_CONFIG) && (link->open)) | 872 | if (link->open) |
879 | netif_device_detach(dev); | 873 | netif_device_detach(dev); |
880 | 874 | ||
881 | return 0; | 875 | return 0; |
@@ -885,7 +879,7 @@ static int netwave_resume(struct pcmcia_device *link) | |||
885 | { | 879 | { |
886 | struct net_device *dev = link->priv; | 880 | struct net_device *dev = link->priv; |
887 | 881 | ||
888 | if ((link->state & DEV_CONFIG) && (link->open)) { | 882 | if (link->open) { |
889 | netwave_reset(dev); | 883 | netwave_reset(dev); |
890 | netif_device_attach(dev); | 884 | netif_device_attach(dev); |
891 | } | 885 | } |