aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/pcmcia/com20020_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/com20020_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/com20020_cs.c')
-rw-r--r--drivers/net/pcmcia/com20020_cs.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c
index a7d675bc605..441de824ab6 100644
--- a/drivers/net/pcmcia/com20020_cs.c
+++ b/drivers/net/pcmcia/com20020_cs.c
@@ -178,7 +178,6 @@ static int com20020_probe(struct pcmcia_device *p_dev)
p_dev->irq.Instance = info->dev = dev;
p_dev->priv = info;
- p_dev->state |= DEV_PRESENT;
return com20020_config(p_dev);
fail_alloc_dev:
@@ -218,8 +217,7 @@ static void com20020_detach(struct pcmcia_device *link)
free_irq(dev->irq, dev);
}
- if (link->state & DEV_CONFIG)
- com20020_release(link);
+ com20020_release(link);
/* Unlink device structure, free bits */
DEBUG(1,"unlinking...\n");
@@ -276,9 +274,6 @@ static int com20020_config(struct pcmcia_device *link)
CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
link->conf.ConfigBase = parse.config.base;
- /* Configure card */
- link->state |= DEV_CONFIG;
-
DEBUG(1,"arcnet: baseport1 is %Xh\n", link->io.BasePort1);
i = !CS_SUCCESS;
if (!link->io.BasePort1)
@@ -328,7 +323,6 @@ static int com20020_config(struct pcmcia_device *link)
lp->card_flags = ARC_CAN_10MBIT; /* pretend all of them can 10Mbit */
link->dev_node = &info->node;
- link->state &= ~DEV_CONFIG_PENDING;
SET_NETDEV_DEV(dev, &handle_to_dev(link));
i = com20020_found(dev, 0); /* calls register_netdev */
@@ -372,7 +366,7 @@ static int com20020_suspend(struct pcmcia_device *link)
com20020_dev_t *info = link->priv;
struct net_device *dev = info->dev;
- if ((link->state & DEV_CONFIG) && (link->open))
+ if (link->open)
netif_device_detach(dev);
return 0;
@@ -383,7 +377,7 @@ static int com20020_resume(struct pcmcia_device *link)
com20020_dev_t *info = link->priv;
struct net_device *dev = info->dev;
- if ((link->state & DEV_CONFIG) && (link->open)) {
+ if (link->open) {
int ioaddr = dev->base_addr;
struct arcnet_local *lp = dev->priv;
ARCRESET;