summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia/qlogic_stub.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/scsi/pcmcia/qlogic_stub.c
parentf6fbe01ac976f3ec618cd5fb71ad9ce2cfa7ab2b (diff)
downloadlinux-e2d4096365e06b9a3799afbadc28b4519c0b3526.tar.gz
linux-e2d4096365e06b9a3799afbadc28b4519c0b3526.tar.bz2
linux-e2d4096365e06b9a3799afbadc28b4519c0b3526.zip
[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/scsi/pcmcia/qlogic_stub.c')
-rw-r--r--drivers/scsi/pcmcia/qlogic_stub.c33
1 files changed, 12 insertions, 21 deletions
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index 61c2eb03a9b5..86c2ac6ae623 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -178,7 +178,6 @@ static int qlogic_probe(struct pcmcia_device *link)
link->conf.IntType = INT_MEMORY_AND_IO;
link->conf.Present = PRESENT_OPTION;
- link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
return qlogic_config(link);
} /* qlogic_attach */
@@ -188,9 +187,7 @@ static void qlogic_detach(struct pcmcia_device *link)
{
DEBUG(0, "qlogic_detach(0x%p)\n", link);
- if (link->state & DEV_CONFIG)
- qlogic_release(link);
-
+ qlogic_release(link);
kfree(link->priv);
} /* qlogic_detach */
@@ -224,9 +221,6 @@ static int qlogic_config(struct pcmcia_device * link)
if ((pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) && (pcmcia_get_tuple_data(link, &tuple) == CS_SUCCESS))
info->manf_id = le16_to_cpu(tuple.TupleData[0]);
- /* Configure card */
- link->state |= DEV_CONFIG;
-
tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
while (1) {
@@ -272,7 +266,6 @@ static int qlogic_config(struct pcmcia_device * link)
link->dev_node = &info->node;
info->host = host;
- link->state &= ~DEV_CONFIG_PENDING;
return 0;
cs_failed:
@@ -302,20 +295,18 @@ static void qlogic_release(struct pcmcia_device *link)
static int qlogic_resume(struct pcmcia_device *link)
{
- if (link->state & DEV_CONFIG) {
- scsi_info_t *info = link->priv;
-
- pcmcia_request_configuration(link, &link->conf);
- if ((info->manf_id == MANFID_MACNICA) ||
- (info->manf_id == MANFID_PIONEER) ||
- (info->manf_id == 0x0098)) {
- outb(0x80, link->io.BasePort1 + 0xd);
- outb(0x24, link->io.BasePort1 + 0x9);
- outb(0x04, link->io.BasePort1 + 0xd);
- }
- /* Ugggglllyyyy!!! */
- qlogicfas408_bus_reset(NULL);
+ scsi_info_t *info = link->priv;
+
+ pcmcia_request_configuration(link, &link->conf);
+ if ((info->manf_id == MANFID_MACNICA) ||
+ (info->manf_id == MANFID_PIONEER) ||
+ (info->manf_id == 0x0098)) {
+ outb(0x80, link->io.BasePort1 + 0xd);
+ outb(0x24, link->io.BasePort1 + 0x9);
+ outb(0x04, link->io.BasePort1 + 0xd);
}
+ /* Ugggglllyyyy!!! */
+ qlogicfas408_bus_reset(NULL);
return 0;
}