summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia/qlogic_stub.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 17:26:06 +0200
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 17:26:06 +0200
commit15b99ac1729503db9e6dc642a50b9b6cb3bf51f9 (patch)
treecfb8897487beba502aac2b28bc35066a87e34299 /drivers/scsi/pcmcia/qlogic_stub.c
parent[PATCH] pcmcia: remove dev_link_t and client_handle_t indirection (diff)
downloadlinux-15b99ac1729503db9e6dc642a50b9b6cb3bf51f9.tar.xz
linux-15b99ac1729503db9e6dc642a50b9b6cb3bf51f9.zip
[PATCH] pcmcia: add return value to _config() functions
Most of the driver initialization isn't done in the .probe function, but in the internal _config() functions. Make them return a value, so that .probe can properly report whether the probing of the device succeeded or not. 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.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index a2a1c4b318e6..61c2eb03a9b5 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -99,7 +99,7 @@ typedef struct scsi_info_t {
static void qlogic_release(struct pcmcia_device *link);
static void qlogic_detach(struct pcmcia_device *p_dev);
-static void qlogic_config(struct pcmcia_device * link);
+static int qlogic_config(struct pcmcia_device * link);
static struct Scsi_Host *qlogic_detect(struct scsi_host_template *host,
struct pcmcia_device *link, int qbase, int qlirq)
@@ -156,7 +156,7 @@ free_scsi_host:
err:
return NULL;
}
-static int qlogic_attach(struct pcmcia_device *link)
+static int qlogic_probe(struct pcmcia_device *link)
{
scsi_info_t *info;
@@ -179,9 +179,7 @@ static int qlogic_attach(struct pcmcia_device *link)
link->conf.Present = PRESENT_OPTION;
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
- qlogic_config(link);
-
- return 0;
+ return qlogic_config(link);
} /* qlogic_attach */
/*====================================================================*/
@@ -202,7 +200,7 @@ static void qlogic_detach(struct pcmcia_device *link)
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-static void qlogic_config(struct pcmcia_device * link)
+static int qlogic_config(struct pcmcia_device * link)
{
scsi_info_t *info = link->priv;
tuple_t tuple;
@@ -267,21 +265,20 @@ static void qlogic_config(struct pcmcia_device * link)
if (!host) {
printk(KERN_INFO "%s: no SCSI devices found\n", qlogic_name);
- goto out;
+ goto cs_failed;
}
sprintf(info->node.dev_name, "scsi%d", host->host_no);
link->dev_node = &info->node;
info->host = host;
-out:
link->state &= ~DEV_CONFIG_PENDING;
- return;
+ return 0;
cs_failed:
cs_error(link, last_fn, last_ret);
pcmcia_disable_device(link);
- return;
+ return -ENODEV;
} /* qlogic_config */
@@ -350,7 +347,7 @@ static struct pcmcia_driver qlogic_cs_driver = {
.drv = {
.name = "qlogic_cs",
},
- .probe = qlogic_attach,
+ .probe = qlogic_probe,
.remove = qlogic_detach,
.id_table = qlogic_ids,
.resume = qlogic_resume,