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/isdn/hisax/sedlbauer_cs.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/isdn/hisax/sedlbauer_cs.c')
-rw-r--r-- | drivers/isdn/hisax/sedlbauer_cs.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c index 2af48a684654..a35a29586a62 100644 --- a/drivers/isdn/hisax/sedlbauer_cs.c +++ b/drivers/isdn/hisax/sedlbauer_cs.c | |||
@@ -95,7 +95,7 @@ module_param(protocol, int, 0); | |||
95 | event handler. | 95 | event handler. |
96 | */ | 96 | */ |
97 | 97 | ||
98 | static void sedlbauer_config(struct pcmcia_device *link); | 98 | static int sedlbauer_config(struct pcmcia_device *link); |
99 | static void sedlbauer_release(struct pcmcia_device *link); | 99 | static void sedlbauer_release(struct pcmcia_device *link); |
100 | 100 | ||
101 | /* | 101 | /* |
@@ -148,7 +148,7 @@ typedef struct local_info_t { | |||
148 | 148 | ||
149 | ======================================================================*/ | 149 | ======================================================================*/ |
150 | 150 | ||
151 | static int sedlbauer_attach(struct pcmcia_device *link) | 151 | static int sedlbauer_probe(struct pcmcia_device *link) |
152 | { | 152 | { |
153 | local_info_t *local; | 153 | local_info_t *local; |
154 | 154 | ||
@@ -187,9 +187,7 @@ static int sedlbauer_attach(struct pcmcia_device *link) | |||
187 | link->conf.IntType = INT_MEMORY_AND_IO; | 187 | link->conf.IntType = INT_MEMORY_AND_IO; |
188 | 188 | ||
189 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 189 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
190 | sedlbauer_config(link); | 190 | return sedlbauer_config(link); |
191 | |||
192 | return 0; | ||
193 | } /* sedlbauer_attach */ | 191 | } /* sedlbauer_attach */ |
194 | 192 | ||
195 | /*====================================================================== | 193 | /*====================================================================== |
@@ -224,7 +222,7 @@ static void sedlbauer_detach(struct pcmcia_device *link) | |||
224 | #define CS_CHECK(fn, ret) \ | 222 | #define CS_CHECK(fn, ret) \ |
225 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 223 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
226 | 224 | ||
227 | static void sedlbauer_config(struct pcmcia_device *link) | 225 | static int sedlbauer_config(struct pcmcia_device *link) |
228 | { | 226 | { |
229 | local_info_t *dev = link->priv; | 227 | local_info_t *dev = link->priv; |
230 | tuple_t tuple; | 228 | tuple_t tuple; |
@@ -423,14 +421,16 @@ static void sedlbauer_config(struct pcmcia_device *link) | |||
423 | printk(KERN_ERR "sedlbauer_cs: failed to initialize SEDLBAUER PCMCIA %d at i/o %#x\n", | 421 | printk(KERN_ERR "sedlbauer_cs: failed to initialize SEDLBAUER PCMCIA %d at i/o %#x\n", |
424 | last_ret, link->io.BasePort1); | 422 | last_ret, link->io.BasePort1); |
425 | sedlbauer_release(link); | 423 | sedlbauer_release(link); |
424 | return -ENODEV; | ||
426 | } else | 425 | } else |
427 | ((local_info_t*)link->priv)->cardnr = last_ret; | 426 | ((local_info_t*)link->priv)->cardnr = last_ret; |
428 | 427 | ||
429 | return; | 428 | return 0; |
430 | 429 | ||
431 | cs_failed: | 430 | cs_failed: |
432 | cs_error(link, last_fn, last_ret); | 431 | cs_error(link, last_fn, last_ret); |
433 | sedlbauer_release(link); | 432 | sedlbauer_release(link); |
433 | return -ENODEV; | ||
434 | 434 | ||
435 | } /* sedlbauer_config */ | 435 | } /* sedlbauer_config */ |
436 | 436 | ||
@@ -493,7 +493,7 @@ static struct pcmcia_driver sedlbauer_driver = { | |||
493 | .drv = { | 493 | .drv = { |
494 | .name = "sedlbauer_cs", | 494 | .name = "sedlbauer_cs", |
495 | }, | 495 | }, |
496 | .probe = sedlbauer_attach, | 496 | .probe = sedlbauer_probe, |
497 | .remove = sedlbauer_detach, | 497 | .remove = sedlbauer_detach, |
498 | .id_table = sedlbauer_ids, | 498 | .id_table = sedlbauer_ids, |
499 | .suspend = sedlbauer_suspend, | 499 | .suspend = sedlbauer_suspend, |