summaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/3c574_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/pcmcia/3c574_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/pcmcia/3c574_cs.c')
-rw-r--r--drivers/net/pcmcia/3c574_cs.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 4611469fdff..70e3cca0978 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -296,7 +296,6 @@ static int tc574_probe(struct pcmcia_device *link)
dev->watchdog_timeo = TX_TIMEOUT;
#endif
- link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
return tc574_config(link);
} /* tc574_attach */
@@ -318,8 +317,7 @@ static void tc574_detach(struct pcmcia_device *link)
if (link->dev_node)
unregister_netdev(dev);
- if (link->state & DEV_CONFIG)
- tc574_release(link);
+ tc574_release(link);
free_netdev(dev);
} /* tc574_detach */
@@ -363,9 +361,6 @@ static int tc574_config(struct pcmcia_device *link)
link->conf.ConfigBase = parse.config.base;
link->conf.Present = parse.config.rmask[0];
- /* Configure card */
- link->state |= DEV_CONFIG;
-
link->io.IOAddrLines = 16;
for (i = j = 0; j < 0x400; j += 0x20) {
link->io.BasePort1 = j ^ 0x300;
@@ -464,7 +459,6 @@ static int tc574_config(struct pcmcia_device *link)
}
}
- link->state &= ~DEV_CONFIG_PENDING;
link->dev_node = &lp->node;
SET_NETDEV_DEV(dev, &handle_to_dev(link));
@@ -509,7 +503,7 @@ static int tc574_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;
@@ -519,7 +513,7 @@ static int tc574_resume(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
- if ((link->state & DEV_CONFIG) && (link->open)) {
+ if (link->open) {
tc574_reset(dev);
netif_device_attach(dev);
}