aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/netwave_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/net/wireless/netwave_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/net/wireless/netwave_cs.c')
-rw-r--r--drivers/net/wireless/netwave_cs.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c
index 2689f3bbc88..fbc8595cde3 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)
dev->stop = &netwave_close;
link->irq.Instance = dev;
- link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
return netwave_pcmcia_config( link);
} /* netwave_attach */
@@ -446,8 +445,7 @@ static void netwave_detach(struct pcmcia_device *link)
DEBUG(0, "netwave_detach(0x%p)\n", link);
- if (link->state & DEV_CONFIG)
- netwave_release(link);
+ netwave_release(link);
if (link->dev_node)
unregister_netdev(dev);
@@ -763,9 +761,6 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
link->conf.ConfigBase = parse.config.base;
link->conf.Present = parse.config.rmask[0];
- /* Configure card */
- link->state |= DEV_CONFIG;
-
/*
* Try allocating IO ports. This tries a few fixed addresses.
* 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) {
strcpy(priv->node.dev_name, dev->name);
link->dev_node = &priv->node;
- link->state &= ~DEV_CONFIG_PENDING;
/* Reset card before reading physical address */
netwave_doreset(dev->base_addr, ramBase);
@@ -875,7 +869,7 @@ static int netwave_suspend(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
- if ((link->state & DEV_CONFIG) && (link->open))
+ if (link->open)
netif_device_detach(dev);
return 0;
@@ -885,7 +879,7 @@ static int netwave_resume(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
- if ((link->state & DEV_CONFIG) && (link->open)) {
+ if (link->open) {
netwave_reset(dev);
netif_device_attach(dev);
}