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/orinoco_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/orinoco_cs.c')
-rw-r--r-- | drivers/net/wireless/orinoco_cs.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c index 405b7baa8bc3..0e92bee16c9b 100644 --- a/drivers/net/wireless/orinoco_cs.c +++ b/drivers/net/wireless/orinoco_cs.c | |||
@@ -63,7 +63,7 @@ struct orinoco_pccard { | |||
63 | /* Function prototypes */ | 63 | /* Function prototypes */ |
64 | /********************************************************************/ | 64 | /********************************************************************/ |
65 | 65 | ||
66 | static void orinoco_cs_config(struct pcmcia_device *link); | 66 | static int orinoco_cs_config(struct pcmcia_device *link); |
67 | static void orinoco_cs_release(struct pcmcia_device *link); | 67 | static void orinoco_cs_release(struct pcmcia_device *link); |
68 | static void orinoco_cs_detach(struct pcmcia_device *p_dev); | 68 | static void orinoco_cs_detach(struct pcmcia_device *p_dev); |
69 | 69 | ||
@@ -104,7 +104,7 @@ orinoco_cs_hard_reset(struct orinoco_private *priv) | |||
104 | * configure the card at this point -- we wait until we receive a card | 104 | * configure the card at this point -- we wait until we receive a card |
105 | * insertion event. */ | 105 | * insertion event. */ |
106 | static int | 106 | static int |
107 | orinoco_cs_attach(struct pcmcia_device *link) | 107 | orinoco_cs_probe(struct pcmcia_device *link) |
108 | { | 108 | { |
109 | struct net_device *dev; | 109 | struct net_device *dev; |
110 | struct orinoco_private *priv; | 110 | struct orinoco_private *priv; |
@@ -135,9 +135,7 @@ orinoco_cs_attach(struct pcmcia_device *link) | |||
135 | link->conf.IntType = INT_MEMORY_AND_IO; | 135 | link->conf.IntType = INT_MEMORY_AND_IO; |
136 | 136 | ||
137 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 137 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
138 | orinoco_cs_config(link); | 138 | return orinoco_cs_config(link); |
139 | |||
140 | return 0; | ||
141 | } /* orinoco_cs_attach */ | 139 | } /* orinoco_cs_attach */ |
142 | 140 | ||
143 | /* | 141 | /* |
@@ -172,7 +170,7 @@ static void orinoco_cs_detach(struct pcmcia_device *link) | |||
172 | last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; \ | 170 | last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; \ |
173 | } while (0) | 171 | } while (0) |
174 | 172 | ||
175 | static void | 173 | static int |
176 | orinoco_cs_config(struct pcmcia_device *link) | 174 | orinoco_cs_config(struct pcmcia_device *link) |
177 | { | 175 | { |
178 | struct net_device *dev = link->priv; | 176 | struct net_device *dev = link->priv; |
@@ -377,13 +375,14 @@ orinoco_cs_config(struct pcmcia_device *link) | |||
377 | link->io.BasePort2 + link->io.NumPorts2 - 1); | 375 | link->io.BasePort2 + link->io.NumPorts2 - 1); |
378 | printk("\n"); | 376 | printk("\n"); |
379 | 377 | ||
380 | return; | 378 | return 0; |
381 | 379 | ||
382 | cs_failed: | 380 | cs_failed: |
383 | cs_error(link, last_fn, last_ret); | 381 | cs_error(link, last_fn, last_ret); |
384 | 382 | ||
385 | failed: | 383 | failed: |
386 | orinoco_cs_release(link); | 384 | orinoco_cs_release(link); |
385 | return -ENODEV; | ||
387 | } /* orinoco_cs_config */ | 386 | } /* orinoco_cs_config */ |
388 | 387 | ||
389 | /* | 388 | /* |
@@ -576,7 +575,7 @@ static struct pcmcia_driver orinoco_driver = { | |||
576 | .drv = { | 575 | .drv = { |
577 | .name = DRIVER_NAME, | 576 | .name = DRIVER_NAME, |
578 | }, | 577 | }, |
579 | .probe = orinoco_cs_attach, | 578 | .probe = orinoco_cs_probe, |
580 | .remove = orinoco_cs_detach, | 579 | .remove = orinoco_cs_detach, |
581 | .id_table = orinoco_cs_ids, | 580 | .id_table = orinoco_cs_ids, |
582 | .suspend = orinoco_cs_suspend, | 581 | .suspend = orinoco_cs_suspend, |