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/avma1_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/avma1_cs.c')
-rw-r--r-- | drivers/isdn/hisax/avma1_cs.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c index ff6b0e185bc4..11c7c4f09e7e 100644 --- a/drivers/isdn/hisax/avma1_cs.c +++ b/drivers/isdn/hisax/avma1_cs.c | |||
@@ -67,7 +67,7 @@ module_param(isdnprot, int, 0); | |||
67 | handler. | 67 | handler. |
68 | */ | 68 | */ |
69 | 69 | ||
70 | static void avma1cs_config(struct pcmcia_device *link); | 70 | static int avma1cs_config(struct pcmcia_device *link); |
71 | static void avma1cs_release(struct pcmcia_device *link); | 71 | static void avma1cs_release(struct pcmcia_device *link); |
72 | 72 | ||
73 | /* | 73 | /* |
@@ -116,7 +116,7 @@ typedef struct local_info_t { | |||
116 | 116 | ||
117 | ======================================================================*/ | 117 | ======================================================================*/ |
118 | 118 | ||
119 | static int avma1cs_attach(struct pcmcia_device *p_dev) | 119 | static int avma1cs_probe(struct pcmcia_device *p_dev) |
120 | { | 120 | { |
121 | local_info_t *local; | 121 | local_info_t *local; |
122 | 122 | ||
@@ -150,9 +150,7 @@ static int avma1cs_attach(struct pcmcia_device *p_dev) | |||
150 | p_dev->conf.Present = PRESENT_OPTION; | 150 | p_dev->conf.Present = PRESENT_OPTION; |
151 | 151 | ||
152 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 152 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
153 | avma1cs_config(p_dev); | 153 | return avma1cs_config(p_dev); |
154 | |||
155 | return 0; | ||
156 | } /* avma1cs_attach */ | 154 | } /* avma1cs_attach */ |
157 | 155 | ||
158 | /*====================================================================== | 156 | /*====================================================================== |
@@ -206,7 +204,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, | |||
206 | return get_tuple(handle, tuple, parse); | 204 | return get_tuple(handle, tuple, parse); |
207 | } | 205 | } |
208 | 206 | ||
209 | static void avma1cs_config(struct pcmcia_device *link) | 207 | static int avma1cs_config(struct pcmcia_device *link) |
210 | { | 208 | { |
211 | tuple_t tuple; | 209 | tuple_t tuple; |
212 | cisparse_t parse; | 210 | cisparse_t parse; |
@@ -242,7 +240,7 @@ static void avma1cs_config(struct pcmcia_device *link) | |||
242 | if (i != CS_SUCCESS) { | 240 | if (i != CS_SUCCESS) { |
243 | cs_error(link, ParseTuple, i); | 241 | cs_error(link, ParseTuple, i); |
244 | link->state &= ~DEV_CONFIG_PENDING; | 242 | link->state &= ~DEV_CONFIG_PENDING; |
245 | return; | 243 | return -ENODEV; |
246 | } | 244 | } |
247 | 245 | ||
248 | /* Configure card */ | 246 | /* Configure card */ |
@@ -325,7 +323,7 @@ found_port: | |||
325 | /* If any step failed, release any partially configured state */ | 323 | /* If any step failed, release any partially configured state */ |
326 | if (i != 0) { | 324 | if (i != 0) { |
327 | avma1cs_release(link); | 325 | avma1cs_release(link); |
328 | return; | 326 | return -ENODEV; |
329 | } | 327 | } |
330 | 328 | ||
331 | printk(KERN_NOTICE "avma1_cs: checking at i/o %#x, irq %d\n", | 329 | printk(KERN_NOTICE "avma1_cs: checking at i/o %#x, irq %d\n", |
@@ -340,10 +338,11 @@ found_port: | |||
340 | if (i < 0) { | 338 | if (i < 0) { |
341 | printk(KERN_ERR "avma1_cs: failed to initialize AVM A1 PCMCIA %d at i/o %#x\n", i, link->io.BasePort1); | 339 | printk(KERN_ERR "avma1_cs: failed to initialize AVM A1 PCMCIA %d at i/o %#x\n", i, link->io.BasePort1); |
342 | avma1cs_release(link); | 340 | avma1cs_release(link); |
343 | return; | 341 | return -ENODEV; |
344 | } | 342 | } |
345 | dev->node.minor = i; | 343 | dev->node.minor = i; |
346 | 344 | ||
345 | return 0; | ||
347 | } /* avma1cs_config */ | 346 | } /* avma1cs_config */ |
348 | 347 | ||
349 | /*====================================================================== | 348 | /*====================================================================== |
@@ -379,7 +378,7 @@ static struct pcmcia_driver avma1cs_driver = { | |||
379 | .drv = { | 378 | .drv = { |
380 | .name = "avma1_cs", | 379 | .name = "avma1_cs", |
381 | }, | 380 | }, |
382 | .probe = avma1cs_attach, | 381 | .probe = avma1cs_probe, |
383 | .remove = avma1cs_detach, | 382 | .remove = avma1cs_detach, |
384 | .id_table = avma1cs_ids, | 383 | .id_table = avma1cs_ids, |
385 | }; | 384 | }; |