summaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/3c589_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/3c589_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/3c589_cs.c')
-rw-r--r--drivers/net/pcmcia/3c589_cs.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index 160d48a8ed8..3d05f66e9c7 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -211,7 +211,6 @@ static int tc589_probe(struct pcmcia_device *link)
#endif
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
- link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
return tc589_config(link);
} /* tc589_attach */
@@ -233,8 +232,7 @@ static void tc589_detach(struct pcmcia_device *link)
if (link->dev_node)
unregister_netdev(dev);
- if (link->state & DEV_CONFIG)
- tc589_release(link);
+ tc589_release(link);
free_netdev(dev);
} /* tc589_detach */
@@ -285,9 +283,6 @@ static int tc589_config(struct pcmcia_device *link)
"3Com card??\n");
multi = (le16_to_cpu(buf[1]) == PRODID_3COM_3C562);
}
-
- /* Configure card */
- link->state |= DEV_CONFIG;
/* For the 3c562, the base address must be xx00-xx7f */
link->io.IOAddrLines = 16;
@@ -338,7 +333,6 @@ static int tc589_config(struct pcmcia_device *link)
printk(KERN_ERR "3c589_cs: invalid if_port requested\n");
link->dev_node = &lp->node;
- link->state &= ~DEV_CONFIG_PENDING;
SET_NETDEV_DEV(dev, &handle_to_dev(link));
if (register_netdev(dev) != 0) {
@@ -383,7 +377,7 @@ static int tc589_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;
@@ -393,7 +387,7 @@ static int tc589_resume(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
- if ((link->state & DEV_CONFIG) && (link->open)) {
+ if (link->open) {
tc589_reset(dev);
netif_device_attach(dev);
}