diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-02 00:09:29 +0100 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 17:26:33 +0200 |
commit | e2d4096365e06b9a3799afbadc28b4519c0b3526 (patch) | |
tree | 90ec691d71f9c0309048714e359b8ba351b533f7 /drivers/net/pcmcia/pcnet_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/pcmcia/pcnet_cs.c')
-rw-r--r-- | drivers/net/pcmcia/pcnet_cs.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index d840c0f03ea..d9661410f2f 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c @@ -264,7 +264,6 @@ static int pcnet_probe(struct pcmcia_device *link) dev->stop = &pcnet_close; dev->set_config = &set_config; - link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; return pcnet_config(link); } /* pcnet_attach */ @@ -286,8 +285,7 @@ static void pcnet_detach(struct pcmcia_device *link) if (link->dev_node) unregister_netdev(dev); - if (link->state & DEV_CONFIG) - pcnet_release(link); + pcnet_release(link); free_netdev(dev); } /* pcnet_detach */ @@ -538,9 +536,6 @@ static int pcnet_config(struct pcmcia_device *link) link->conf.ConfigBase = parse.config.base; link->conf.Present = parse.config.rmask[0]; - /* Configure card */ - link->state |= DEV_CONFIG; - tuple.DesiredTuple = CISTPL_MANFID; tuple.Attributes = TUPLE_RETURN_COMMON; if ((pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) && @@ -667,7 +662,6 @@ static int pcnet_config(struct pcmcia_device *link) } link->dev_node = &info->node; - link->state &= ~DEV_CONFIG_PENDING; SET_NETDEV_DEV(dev, &handle_to_dev(link)); #ifdef CONFIG_NET_POLL_CONTROLLER @@ -705,7 +699,6 @@ cs_failed: cs_error(link, last_fn, last_ret); failed: pcnet_release(link); - link->state &= ~DEV_CONFIG_PENDING; return -ENODEV; } /* pcnet_config */ @@ -742,7 +735,7 @@ static int pcnet_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; @@ -752,7 +745,7 @@ static int pcnet_resume(struct pcmcia_device *link) { struct net_device *dev = link->priv; - if ((link->state & DEV_CONFIG) && (link->open)) { + if (link->open) { pcnet_reset_8390(dev); NS8390_init(dev, 1); netif_device_attach(dev); |