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/net/wireless/airo_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/net/wireless/airo_cs.c')
-rw-r--r-- | drivers/net/wireless/airo_cs.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c index 76970197f98f..97f41565fca8 100644 --- a/drivers/net/wireless/airo_cs.c +++ b/drivers/net/wireless/airo_cs.c | |||
@@ -80,7 +80,7 @@ MODULE_SUPPORTED_DEVICE("Aironet 4500, 4800 and Cisco 340 PCMCIA cards"); | |||
80 | event handler. | 80 | event handler. |
81 | */ | 81 | */ |
82 | 82 | ||
83 | static void airo_config(struct pcmcia_device *link); | 83 | static int airo_config(struct pcmcia_device *link); |
84 | static void airo_release(struct pcmcia_device *link); | 84 | static void airo_release(struct pcmcia_device *link); |
85 | 85 | ||
86 | /* | 86 | /* |
@@ -141,7 +141,7 @@ typedef struct local_info_t { | |||
141 | 141 | ||
142 | ======================================================================*/ | 142 | ======================================================================*/ |
143 | 143 | ||
144 | static int airo_attach(struct pcmcia_device *p_dev) | 144 | static int airo_probe(struct pcmcia_device *p_dev) |
145 | { | 145 | { |
146 | local_info_t *local; | 146 | local_info_t *local; |
147 | 147 | ||
@@ -171,9 +171,7 @@ static int airo_attach(struct pcmcia_device *p_dev) | |||
171 | p_dev->priv = local; | 171 | p_dev->priv = local; |
172 | 172 | ||
173 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 173 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
174 | airo_config(p_dev); | 174 | return airo_config(p_dev); |
175 | |||
176 | return 0; | ||
177 | } /* airo_attach */ | 175 | } /* airo_attach */ |
178 | 176 | ||
179 | /*====================================================================== | 177 | /*====================================================================== |
@@ -211,7 +209,7 @@ static void airo_detach(struct pcmcia_device *link) | |||
211 | #define CS_CHECK(fn, ret) \ | 209 | #define CS_CHECK(fn, ret) \ |
212 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 210 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
213 | 211 | ||
214 | static void airo_config(struct pcmcia_device *link) | 212 | static int airo_config(struct pcmcia_device *link) |
215 | { | 213 | { |
216 | tuple_t tuple; | 214 | tuple_t tuple; |
217 | cisparse_t parse; | 215 | cisparse_t parse; |
@@ -386,12 +384,12 @@ static void airo_config(struct pcmcia_device *link) | |||
386 | printk("\n"); | 384 | printk("\n"); |
387 | 385 | ||
388 | link->state &= ~DEV_CONFIG_PENDING; | 386 | link->state &= ~DEV_CONFIG_PENDING; |
389 | return; | 387 | return 0; |
390 | 388 | ||
391 | cs_failed: | 389 | cs_failed: |
392 | cs_error(link, last_fn, last_ret); | 390 | cs_error(link, last_fn, last_ret); |
393 | airo_release(link); | 391 | airo_release(link); |
394 | 392 | return -ENODEV; | |
395 | } /* airo_config */ | 393 | } /* airo_config */ |
396 | 394 | ||
397 | /*====================================================================== | 395 | /*====================================================================== |
@@ -444,7 +442,7 @@ static struct pcmcia_driver airo_driver = { | |||
444 | .drv = { | 442 | .drv = { |
445 | .name = "airo_cs", | 443 | .name = "airo_cs", |
446 | }, | 444 | }, |
447 | .probe = airo_attach, | 445 | .probe = airo_probe, |
448 | .remove = airo_detach, | 446 | .remove = airo_detach, |
449 | .id_table = airo_ids, | 447 | .id_table = airo_ids, |
450 | .suspend = airo_suspend, | 448 | .suspend = airo_suspend, |