diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:26:06 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:26:06 -0500 |
commit | 15b99ac1729503db9e6dc642a50b9b6cb3bf51f9 (patch) | |
tree | cfb8897487beba502aac2b28bc35066a87e34299 /drivers/scsi/pcmcia/qlogic_stub.c | |
parent | fba395eee7d3f342ca739c20f5b3ee635d0420a0 (diff) |
[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.c | 19 |
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 { | |||
99 | 99 | ||
100 | static void qlogic_release(struct pcmcia_device *link); | 100 | static void qlogic_release(struct pcmcia_device *link); |
101 | static void qlogic_detach(struct pcmcia_device *p_dev); | 101 | static void qlogic_detach(struct pcmcia_device *p_dev); |
102 | static void qlogic_config(struct pcmcia_device * link); | 102 | static int qlogic_config(struct pcmcia_device * link); |
103 | 103 | ||
104 | static struct Scsi_Host *qlogic_detect(struct scsi_host_template *host, | 104 | static struct Scsi_Host *qlogic_detect(struct scsi_host_template *host, |
105 | struct pcmcia_device *link, int qbase, int qlirq) | 105 | struct pcmcia_device *link, int qbase, int qlirq) |
@@ -156,7 +156,7 @@ free_scsi_host: | |||
156 | err: | 156 | err: |
157 | return NULL; | 157 | return NULL; |
158 | } | 158 | } |
159 | static int qlogic_attach(struct pcmcia_device *link) | 159 | static int qlogic_probe(struct pcmcia_device *link) |
160 | { | 160 | { |
161 | scsi_info_t *info; | 161 | scsi_info_t *info; |
162 | 162 | ||
@@ -179,9 +179,7 @@ static int qlogic_attach(struct pcmcia_device *link) | |||
179 | link->conf.Present = PRESENT_OPTION; | 179 | link->conf.Present = PRESENT_OPTION; |
180 | 180 | ||
181 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 181 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
182 | qlogic_config(link); | 182 | return qlogic_config(link); |
183 | |||
184 | return 0; | ||
185 | } /* qlogic_attach */ | 183 | } /* qlogic_attach */ |
186 | 184 | ||
187 | /*====================================================================*/ | 185 | /*====================================================================*/ |
@@ -202,7 +200,7 @@ static void qlogic_detach(struct pcmcia_device *link) | |||
202 | #define CS_CHECK(fn, ret) \ | 200 | #define CS_CHECK(fn, ret) \ |
203 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 201 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
204 | 202 | ||
205 | static void qlogic_config(struct pcmcia_device * link) | 203 | static int qlogic_config(struct pcmcia_device * link) |
206 | { | 204 | { |
207 | scsi_info_t *info = link->priv; | 205 | scsi_info_t *info = link->priv; |
208 | tuple_t tuple; | 206 | tuple_t tuple; |
@@ -267,21 +265,20 @@ static void qlogic_config(struct pcmcia_device * link) | |||
267 | 265 | ||
268 | if (!host) { | 266 | if (!host) { |
269 | printk(KERN_INFO "%s: no SCSI devices found\n", qlogic_name); | 267 | printk(KERN_INFO "%s: no SCSI devices found\n", qlogic_name); |
270 | goto out; | 268 | goto cs_failed; |
271 | } | 269 | } |
272 | 270 | ||
273 | sprintf(info->node.dev_name, "scsi%d", host->host_no); | 271 | sprintf(info->node.dev_name, "scsi%d", host->host_no); |
274 | link->dev_node = &info->node; | 272 | link->dev_node = &info->node; |
275 | info->host = host; | 273 | info->host = host; |
276 | 274 | ||
277 | out: | ||
278 | link->state &= ~DEV_CONFIG_PENDING; | 275 | link->state &= ~DEV_CONFIG_PENDING; |
279 | return; | 276 | return 0; |
280 | 277 | ||
281 | cs_failed: | 278 | cs_failed: |
282 | cs_error(link, last_fn, last_ret); | 279 | cs_error(link, last_fn, last_ret); |
283 | pcmcia_disable_device(link); | 280 | pcmcia_disable_device(link); |
284 | return; | 281 | return -ENODEV; |
285 | 282 | ||
286 | } /* qlogic_config */ | 283 | } /* qlogic_config */ |
287 | 284 | ||
@@ -350,7 +347,7 @@ static struct pcmcia_driver qlogic_cs_driver = { | |||
350 | .drv = { | 347 | .drv = { |
351 | .name = "qlogic_cs", | 348 | .name = "qlogic_cs", |
352 | }, | 349 | }, |
353 | .probe = qlogic_attach, | 350 | .probe = qlogic_probe, |
354 | .remove = qlogic_detach, | 351 | .remove = qlogic_detach, |
355 | .id_table = qlogic_ids, | 352 | .id_table = qlogic_ids, |
356 | .resume = qlogic_resume, | 353 | .resume = qlogic_resume, |