summaryrefslogtreecommitdiff
path: root/drivers/ide
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/ide
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/ide')
-rw-r--r--drivers/ide/legacy/ide-cs.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
index 56c8e828c6e6..4961f1e764a7 100644
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -125,7 +125,6 @@ static int ide_probe(struct pcmcia_device *link)
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
- link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
return ide_config(link);
} /* ide_attach */
@@ -142,8 +141,7 @@ static void ide_detach(struct pcmcia_device *link)
{
DEBUG(0, "ide_detach(0x%p)\n", link);
- if (link->state & DEV_CONFIG)
- ide_release(link);
+ ide_release(link);
kfree(link->priv);
} /* ide_detach */
@@ -209,9 +207,6 @@ static int ide_config(struct pcmcia_device *link)
((stk->parse.manfid.card == PRODID_KME_KXLC005_A) ||
(stk->parse.manfid.card == PRODID_KME_KXLC005_B)));
- /* Configure card */
- link->state |= DEV_CONFIG;
-
/* Not sure if this is right... look up the current Vcc */
CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &stk->conf));
@@ -323,7 +318,6 @@ static int ide_config(struct pcmcia_device *link)
printk(KERN_INFO "ide-cs: %s: Vpp = %d.%d\n",
info->node.dev_name, link->conf.Vpp / 10, link->conf.Vpp % 10);
- link->state &= ~DEV_CONFIG_PENDING;
kfree(stk);
return 0;
@@ -336,7 +330,6 @@ cs_failed:
failed:
kfree(stk);
ide_release(link);
- link->state &= ~DEV_CONFIG_PENDING;
return -ENODEV;
} /* ide_config */