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 | |
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')
-rw-r--r-- | drivers/net/pcmcia/3c574_cs.c | 16 | ||||
-rw-r--r-- | drivers/net/pcmcia/3c589_cs.c | 17 | ||||
-rw-r--r-- | drivers/net/pcmcia/axnet_cs.c | 16 | ||||
-rw-r--r-- | drivers/net/pcmcia/com20020_cs.c | 15 | ||||
-rw-r--r-- | drivers/net/pcmcia/fmvj18x_cs.c | 16 | ||||
-rw-r--r-- | drivers/net/pcmcia/ibmtr_cs.c | 11 | ||||
-rw-r--r-- | drivers/net/pcmcia/nmclan_cs.c | 23 | ||||
-rw-r--r-- | drivers/net/pcmcia/pcnet_cs.c | 12 | ||||
-rw-r--r-- | drivers/net/pcmcia/smc91c92_cs.c | 16 | ||||
-rw-r--r-- | drivers/net/pcmcia/xirc2ps_cs.c | 17 | ||||
-rw-r--r-- | drivers/net/wireless/airo_cs.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/atmel_cs.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_cs.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/netwave_cs.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco_cs.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/ray_cs.c | 19 | ||||
-rw-r--r-- | drivers/net/wireless/spectrum_cs.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/wavelan_cs.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/wl3501_cs.c | 18 |
19 files changed, 145 insertions, 161 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index f4e293bd04dc..4611469fdff9 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c | |||
@@ -225,7 +225,7 @@ static char mii_preamble_required = 0; | |||
225 | 225 | ||
226 | /* Index of functions. */ | 226 | /* Index of functions. */ |
227 | 227 | ||
228 | static void tc574_config(struct pcmcia_device *link); | 228 | static int tc574_config(struct pcmcia_device *link); |
229 | static void tc574_release(struct pcmcia_device *link); | 229 | static void tc574_release(struct pcmcia_device *link); |
230 | 230 | ||
231 | static void mdio_sync(kio_addr_t ioaddr, int bits); | 231 | static void mdio_sync(kio_addr_t ioaddr, int bits); |
@@ -256,7 +256,7 @@ static void tc574_detach(struct pcmcia_device *p_dev); | |||
256 | with Card Services. | 256 | with Card Services. |
257 | */ | 257 | */ |
258 | 258 | ||
259 | static int tc574_attach(struct pcmcia_device *link) | 259 | static int tc574_probe(struct pcmcia_device *link) |
260 | { | 260 | { |
261 | struct el3_private *lp; | 261 | struct el3_private *lp; |
262 | struct net_device *dev; | 262 | struct net_device *dev; |
@@ -297,9 +297,7 @@ static int tc574_attach(struct pcmcia_device *link) | |||
297 | #endif | 297 | #endif |
298 | 298 | ||
299 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 299 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
300 | tc574_config(link); | 300 | return tc574_config(link); |
301 | |||
302 | return 0; | ||
303 | } /* tc574_attach */ | 301 | } /* tc574_attach */ |
304 | 302 | ||
305 | /* | 303 | /* |
@@ -337,7 +335,7 @@ static void tc574_detach(struct pcmcia_device *link) | |||
337 | 335 | ||
338 | static const char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"}; | 336 | static const char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"}; |
339 | 337 | ||
340 | static void tc574_config(struct pcmcia_device *link) | 338 | static int tc574_config(struct pcmcia_device *link) |
341 | { | 339 | { |
342 | struct net_device *dev = link->priv; | 340 | struct net_device *dev = link->priv; |
343 | struct el3_private *lp = netdev_priv(dev); | 341 | struct el3_private *lp = netdev_priv(dev); |
@@ -486,13 +484,13 @@ static void tc574_config(struct pcmcia_device *link) | |||
486 | 8 << config.u.ram_size, ram_split[config.u.ram_split], | 484 | 8 << config.u.ram_size, ram_split[config.u.ram_split], |
487 | config.u.autoselect ? "autoselect " : ""); | 485 | config.u.autoselect ? "autoselect " : ""); |
488 | 486 | ||
489 | return; | 487 | return 0; |
490 | 488 | ||
491 | cs_failed: | 489 | cs_failed: |
492 | cs_error(link, last_fn, last_ret); | 490 | cs_error(link, last_fn, last_ret); |
493 | failed: | 491 | failed: |
494 | tc574_release(link); | 492 | tc574_release(link); |
495 | return; | 493 | return -ENODEV; |
496 | 494 | ||
497 | } /* tc574_config */ | 495 | } /* tc574_config */ |
498 | 496 | ||
@@ -1223,7 +1221,7 @@ static struct pcmcia_driver tc574_driver = { | |||
1223 | .drv = { | 1221 | .drv = { |
1224 | .name = "3c574_cs", | 1222 | .name = "3c574_cs", |
1225 | }, | 1223 | }, |
1226 | .probe = tc574_attach, | 1224 | .probe = tc574_probe, |
1227 | .remove = tc574_detach, | 1225 | .remove = tc574_detach, |
1228 | .id_table = tc574_ids, | 1226 | .id_table = tc574_ids, |
1229 | .suspend = tc574_suspend, | 1227 | .suspend = tc574_suspend, |
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c index 565063d49334..160d48a8ed88 100644 --- a/drivers/net/pcmcia/3c589_cs.c +++ b/drivers/net/pcmcia/3c589_cs.c | |||
@@ -142,7 +142,7 @@ DRV_NAME ".c " DRV_VERSION " 2001/10/13 00:08:50 (David Hinds)"; | |||
142 | 142 | ||
143 | /*====================================================================*/ | 143 | /*====================================================================*/ |
144 | 144 | ||
145 | static void tc589_config(struct pcmcia_device *link); | 145 | static int tc589_config(struct pcmcia_device *link); |
146 | static void tc589_release(struct pcmcia_device *link); | 146 | static void tc589_release(struct pcmcia_device *link); |
147 | 147 | ||
148 | static u16 read_eeprom(kio_addr_t ioaddr, int index); | 148 | static u16 read_eeprom(kio_addr_t ioaddr, int index); |
@@ -170,7 +170,7 @@ static void tc589_detach(struct pcmcia_device *p_dev); | |||
170 | 170 | ||
171 | ======================================================================*/ | 171 | ======================================================================*/ |
172 | 172 | ||
173 | static int tc589_attach(struct pcmcia_device *link) | 173 | static int tc589_probe(struct pcmcia_device *link) |
174 | { | 174 | { |
175 | struct el3_private *lp; | 175 | struct el3_private *lp; |
176 | struct net_device *dev; | 176 | struct net_device *dev; |
@@ -212,9 +212,7 @@ static int tc589_attach(struct pcmcia_device *link) | |||
212 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); | 212 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); |
213 | 213 | ||
214 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 214 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
215 | tc589_config(link); | 215 | return tc589_config(link); |
216 | |||
217 | return 0; | ||
218 | } /* tc589_attach */ | 216 | } /* tc589_attach */ |
219 | 217 | ||
220 | /*====================================================================== | 218 | /*====================================================================== |
@@ -252,7 +250,7 @@ static void tc589_detach(struct pcmcia_device *link) | |||
252 | #define CS_CHECK(fn, ret) \ | 250 | #define CS_CHECK(fn, ret) \ |
253 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 251 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
254 | 252 | ||
255 | static void tc589_config(struct pcmcia_device *link) | 253 | static int tc589_config(struct pcmcia_device *link) |
256 | { | 254 | { |
257 | struct net_device *dev = link->priv; | 255 | struct net_device *dev = link->priv; |
258 | struct el3_private *lp = netdev_priv(dev); | 256 | struct el3_private *lp = netdev_priv(dev); |
@@ -359,14 +357,13 @@ static void tc589_config(struct pcmcia_device *link) | |||
359 | printk(KERN_INFO " %dK FIFO split %s Rx:Tx, %s xcvr\n", | 357 | printk(KERN_INFO " %dK FIFO split %s Rx:Tx, %s xcvr\n", |
360 | (fifo & 7) ? 32 : 8, ram_split[(fifo >> 16) & 3], | 358 | (fifo & 7) ? 32 : 8, ram_split[(fifo >> 16) & 3], |
361 | if_names[dev->if_port]); | 359 | if_names[dev->if_port]); |
362 | return; | 360 | return 0; |
363 | 361 | ||
364 | cs_failed: | 362 | cs_failed: |
365 | cs_error(link, last_fn, last_ret); | 363 | cs_error(link, last_fn, last_ret); |
366 | failed: | 364 | failed: |
367 | tc589_release(link); | 365 | tc589_release(link); |
368 | return; | 366 | return -ENODEV; |
369 | |||
370 | } /* tc589_config */ | 367 | } /* tc589_config */ |
371 | 368 | ||
372 | /*====================================================================== | 369 | /*====================================================================== |
@@ -997,7 +994,7 @@ static struct pcmcia_driver tc589_driver = { | |||
997 | .drv = { | 994 | .drv = { |
998 | .name = "3c589_cs", | 995 | .name = "3c589_cs", |
999 | }, | 996 | }, |
1000 | .probe = tc589_attach, | 997 | .probe = tc589_probe, |
1001 | .remove = tc589_detach, | 998 | .remove = tc589_detach, |
1002 | .id_table = tc589_ids, | 999 | .id_table = tc589_ids, |
1003 | .suspend = tc589_suspend, | 1000 | .suspend = tc589_suspend, |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 88f180e98e81..f6ca85d77c7d 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -86,7 +86,7 @@ static char *version = | |||
86 | 86 | ||
87 | /*====================================================================*/ | 87 | /*====================================================================*/ |
88 | 88 | ||
89 | static void axnet_config(struct pcmcia_device *link); | 89 | static int axnet_config(struct pcmcia_device *link); |
90 | static void axnet_release(struct pcmcia_device *link); | 90 | static void axnet_release(struct pcmcia_device *link); |
91 | static int axnet_open(struct net_device *dev); | 91 | static int axnet_open(struct net_device *dev); |
92 | static int axnet_close(struct net_device *dev); | 92 | static int axnet_close(struct net_device *dev); |
@@ -142,7 +142,7 @@ static inline axnet_dev_t *PRIV(struct net_device *dev) | |||
142 | 142 | ||
143 | ======================================================================*/ | 143 | ======================================================================*/ |
144 | 144 | ||
145 | static int axnet_attach(struct pcmcia_device *link) | 145 | static int axnet_probe(struct pcmcia_device *link) |
146 | { | 146 | { |
147 | axnet_dev_t *info; | 147 | axnet_dev_t *info; |
148 | struct net_device *dev; | 148 | struct net_device *dev; |
@@ -169,9 +169,7 @@ static int axnet_attach(struct pcmcia_device *link) | |||
169 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); | 169 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); |
170 | 170 | ||
171 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 171 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
172 | axnet_config(link); | 172 | return axnet_config(link); |
173 | |||
174 | return 0; | ||
175 | } /* axnet_attach */ | 173 | } /* axnet_attach */ |
176 | 174 | ||
177 | /*====================================================================== | 175 | /*====================================================================== |
@@ -288,7 +286,7 @@ static int try_io_port(struct pcmcia_device *link) | |||
288 | } | 286 | } |
289 | } | 287 | } |
290 | 288 | ||
291 | static void axnet_config(struct pcmcia_device *link) | 289 | static int axnet_config(struct pcmcia_device *link) |
292 | { | 290 | { |
293 | struct net_device *dev = link->priv; | 291 | struct net_device *dev = link->priv; |
294 | axnet_dev_t *info = PRIV(dev); | 292 | axnet_dev_t *info = PRIV(dev); |
@@ -425,14 +423,14 @@ static void axnet_config(struct pcmcia_device *link) | |||
425 | } else { | 423 | } else { |
426 | printk(KERN_NOTICE " No MII transceivers found!\n"); | 424 | printk(KERN_NOTICE " No MII transceivers found!\n"); |
427 | } | 425 | } |
428 | return; | 426 | return 0; |
429 | 427 | ||
430 | cs_failed: | 428 | cs_failed: |
431 | cs_error(link, last_fn, last_ret); | 429 | cs_error(link, last_fn, last_ret); |
432 | failed: | 430 | failed: |
433 | axnet_release(link); | 431 | axnet_release(link); |
434 | link->state &= ~DEV_CONFIG_PENDING; | 432 | link->state &= ~DEV_CONFIG_PENDING; |
435 | return; | 433 | return -ENODEV; |
436 | } /* axnet_config */ | 434 | } /* axnet_config */ |
437 | 435 | ||
438 | /*====================================================================== | 436 | /*====================================================================== |
@@ -806,7 +804,7 @@ static struct pcmcia_driver axnet_cs_driver = { | |||
806 | .drv = { | 804 | .drv = { |
807 | .name = "axnet_cs", | 805 | .name = "axnet_cs", |
808 | }, | 806 | }, |
809 | .probe = axnet_attach, | 807 | .probe = axnet_probe, |
810 | .remove = axnet_detach, | 808 | .remove = axnet_detach, |
811 | .id_table = axnet_ids, | 809 | .id_table = axnet_ids, |
812 | .suspend = axnet_suspend, | 810 | .suspend = axnet_suspend, |
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c index a9bcfb4ba15e..a7d675bc6051 100644 --- a/drivers/net/pcmcia/com20020_cs.c +++ b/drivers/net/pcmcia/com20020_cs.c | |||
@@ -118,7 +118,7 @@ MODULE_LICENSE("GPL"); | |||
118 | 118 | ||
119 | /*====================================================================*/ | 119 | /*====================================================================*/ |
120 | 120 | ||
121 | static void com20020_config(struct pcmcia_device *link); | 121 | static int com20020_config(struct pcmcia_device *link); |
122 | static void com20020_release(struct pcmcia_device *link); | 122 | static void com20020_release(struct pcmcia_device *link); |
123 | 123 | ||
124 | static void com20020_detach(struct pcmcia_device *p_dev); | 124 | static void com20020_detach(struct pcmcia_device *p_dev); |
@@ -138,7 +138,7 @@ typedef struct com20020_dev_t { | |||
138 | 138 | ||
139 | ======================================================================*/ | 139 | ======================================================================*/ |
140 | 140 | ||
141 | static int com20020_attach(struct pcmcia_device *p_dev) | 141 | static int com20020_probe(struct pcmcia_device *p_dev) |
142 | { | 142 | { |
143 | com20020_dev_t *info; | 143 | com20020_dev_t *info; |
144 | struct net_device *dev; | 144 | struct net_device *dev; |
@@ -179,9 +179,7 @@ static int com20020_attach(struct pcmcia_device *p_dev) | |||
179 | p_dev->priv = info; | 179 | p_dev->priv = info; |
180 | 180 | ||
181 | p_dev->state |= DEV_PRESENT; | 181 | p_dev->state |= DEV_PRESENT; |
182 | com20020_config(p_dev); | 182 | return com20020_config(p_dev); |
183 | |||
184 | return 0; | ||
185 | 183 | ||
186 | fail_alloc_dev: | 184 | fail_alloc_dev: |
187 | kfree(info); | 185 | kfree(info); |
@@ -250,7 +248,7 @@ static void com20020_detach(struct pcmcia_device *link) | |||
250 | #define CS_CHECK(fn, ret) \ | 248 | #define CS_CHECK(fn, ret) \ |
251 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 249 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
252 | 250 | ||
253 | static void com20020_config(struct pcmcia_device *link) | 251 | static int com20020_config(struct pcmcia_device *link) |
254 | { | 252 | { |
255 | struct arcnet_local *lp; | 253 | struct arcnet_local *lp; |
256 | tuple_t tuple; | 254 | tuple_t tuple; |
@@ -345,13 +343,14 @@ static void com20020_config(struct pcmcia_device *link) | |||
345 | 343 | ||
346 | DEBUG(1,KERN_INFO "%s: port %#3lx, irq %d\n", | 344 | DEBUG(1,KERN_INFO "%s: port %#3lx, irq %d\n", |
347 | dev->name, dev->base_addr, dev->irq); | 345 | dev->name, dev->base_addr, dev->irq); |
348 | return; | 346 | return 0; |
349 | 347 | ||
350 | cs_failed: | 348 | cs_failed: |
351 | cs_error(link, last_fn, last_ret); | 349 | cs_error(link, last_fn, last_ret); |
352 | failed: | 350 | failed: |
353 | DEBUG(1,"com20020_config failed...\n"); | 351 | DEBUG(1,"com20020_config failed...\n"); |
354 | com20020_release(link); | 352 | com20020_release(link); |
353 | return -ENODEV; | ||
355 | } /* com20020_config */ | 354 | } /* com20020_config */ |
356 | 355 | ||
357 | /*====================================================================== | 356 | /*====================================================================== |
@@ -404,7 +403,7 @@ static struct pcmcia_driver com20020_cs_driver = { | |||
404 | .drv = { | 403 | .drv = { |
405 | .name = "com20020_cs", | 404 | .name = "com20020_cs", |
406 | }, | 405 | }, |
407 | .probe = com20020_attach, | 406 | .probe = com20020_probe, |
408 | .remove = com20020_detach, | 407 | .remove = com20020_detach, |
409 | .id_table = com20020_ids, | 408 | .id_table = com20020_ids, |
410 | .suspend = com20020_suspend, | 409 | .suspend = com20020_suspend, |
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index ad3e490bb016..d9c83b290095 100644 --- a/drivers/net/pcmcia/fmvj18x_cs.c +++ b/drivers/net/pcmcia/fmvj18x_cs.c | |||
@@ -84,7 +84,7 @@ static char *version = DRV_NAME ".c " DRV_VERSION " 2002/03/23"; | |||
84 | /* | 84 | /* |
85 | PCMCIA event handlers | 85 | PCMCIA event handlers |
86 | */ | 86 | */ |
87 | static void fmvj18x_config(struct pcmcia_device *link); | 87 | static int fmvj18x_config(struct pcmcia_device *link); |
88 | static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id); | 88 | static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id); |
89 | static int fmvj18x_setup_mfc(struct pcmcia_device *link); | 89 | static int fmvj18x_setup_mfc(struct pcmcia_device *link); |
90 | static void fmvj18x_release(struct pcmcia_device *link); | 90 | static void fmvj18x_release(struct pcmcia_device *link); |
@@ -228,7 +228,7 @@ typedef struct local_info_t { | |||
228 | #define BANK_1U 0x24 /* bank 1 (CONFIG_1) */ | 228 | #define BANK_1U 0x24 /* bank 1 (CONFIG_1) */ |
229 | #define BANK_2U 0x28 /* bank 2 (CONFIG_1) */ | 229 | #define BANK_2U 0x28 /* bank 2 (CONFIG_1) */ |
230 | 230 | ||
231 | static int fmvj18x_attach(struct pcmcia_device *link) | 231 | static int fmvj18x_probe(struct pcmcia_device *link) |
232 | { | 232 | { |
233 | local_info_t *lp; | 233 | local_info_t *lp; |
234 | struct net_device *dev; | 234 | struct net_device *dev; |
@@ -273,9 +273,7 @@ static int fmvj18x_attach(struct pcmcia_device *link) | |||
273 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); | 273 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); |
274 | 274 | ||
275 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 275 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
276 | fmvj18x_config(link); | 276 | return fmvj18x_config(link); |
277 | |||
278 | return 0; | ||
279 | } /* fmvj18x_attach */ | 277 | } /* fmvj18x_attach */ |
280 | 278 | ||
281 | /*====================================================================*/ | 279 | /*====================================================================*/ |
@@ -339,7 +337,7 @@ static int ungermann_try_io_port(struct pcmcia_device *link) | |||
339 | return ret; /* RequestIO failed */ | 337 | return ret; /* RequestIO failed */ |
340 | } | 338 | } |
341 | 339 | ||
342 | static void fmvj18x_config(struct pcmcia_device *link) | 340 | static int fmvj18x_config(struct pcmcia_device *link) |
343 | { | 341 | { |
344 | struct net_device *dev = link->priv; | 342 | struct net_device *dev = link->priv; |
345 | local_info_t *lp = netdev_priv(dev); | 343 | local_info_t *lp = netdev_priv(dev); |
@@ -552,7 +550,7 @@ static void fmvj18x_config(struct pcmcia_device *link) | |||
552 | for (i = 0; i < 6; i++) | 550 | for (i = 0; i < 6; i++) |
553 | printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); | 551 | printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); |
554 | 552 | ||
555 | return; | 553 | return 0; |
556 | 554 | ||
557 | cs_failed: | 555 | cs_failed: |
558 | /* All Card Services errors end up here */ | 556 | /* All Card Services errors end up here */ |
@@ -560,7 +558,7 @@ cs_failed: | |||
560 | failed: | 558 | failed: |
561 | fmvj18x_release(link); | 559 | fmvj18x_release(link); |
562 | link->state &= ~DEV_CONFIG_PENDING; | 560 | link->state &= ~DEV_CONFIG_PENDING; |
563 | 561 | return -ENODEV; | |
564 | } /* fmvj18x_config */ | 562 | } /* fmvj18x_config */ |
565 | /*====================================================================*/ | 563 | /*====================================================================*/ |
566 | 564 | ||
@@ -720,7 +718,7 @@ static struct pcmcia_driver fmvj18x_cs_driver = { | |||
720 | .drv = { | 718 | .drv = { |
721 | .name = "fmvj18x_cs", | 719 | .name = "fmvj18x_cs", |
722 | }, | 720 | }, |
723 | .probe = fmvj18x_attach, | 721 | .probe = fmvj18x_probe, |
724 | .remove = fmvj18x_detach, | 722 | .remove = fmvj18x_detach, |
725 | .id_table = fmvj18x_ids, | 723 | .id_table = fmvj18x_ids, |
726 | .suspend = fmvj18x_suspend, | 724 | .suspend = fmvj18x_suspend, |
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c index 1b8b44dc4c50..e038d9278a59 100644 --- a/drivers/net/pcmcia/ibmtr_cs.c +++ b/drivers/net/pcmcia/ibmtr_cs.c | |||
@@ -105,7 +105,7 @@ MODULE_LICENSE("GPL"); | |||
105 | 105 | ||
106 | /*====================================================================*/ | 106 | /*====================================================================*/ |
107 | 107 | ||
108 | static void ibmtr_config(struct pcmcia_device *link); | 108 | static int ibmtr_config(struct pcmcia_device *link); |
109 | static void ibmtr_hw_setup(struct net_device *dev, u_int mmiobase); | 109 | static void ibmtr_hw_setup(struct net_device *dev, u_int mmiobase); |
110 | static void ibmtr_release(struct pcmcia_device *link); | 110 | static void ibmtr_release(struct pcmcia_device *link); |
111 | static void ibmtr_detach(struct pcmcia_device *p_dev); | 111 | static void ibmtr_detach(struct pcmcia_device *p_dev); |
@@ -174,9 +174,7 @@ static int ibmtr_attach(struct pcmcia_device *link) | |||
174 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); | 174 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); |
175 | 175 | ||
176 | link->state |= DEV_PRESENT; | 176 | link->state |= DEV_PRESENT; |
177 | ibmtr_config(link); | 177 | return ibmtr_config(link); |
178 | |||
179 | return 0; | ||
180 | } /* ibmtr_attach */ | 178 | } /* ibmtr_attach */ |
181 | 179 | ||
182 | /*====================================================================== | 180 | /*====================================================================== |
@@ -220,7 +218,7 @@ static void ibmtr_detach(struct pcmcia_device *link) | |||
220 | #define CS_CHECK(fn, ret) \ | 218 | #define CS_CHECK(fn, ret) \ |
221 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 219 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
222 | 220 | ||
223 | static void ibmtr_config(struct pcmcia_device *link) | 221 | static int ibmtr_config(struct pcmcia_device *link) |
224 | { | 222 | { |
225 | ibmtr_dev_t *info = link->priv; | 223 | ibmtr_dev_t *info = link->priv; |
226 | struct net_device *dev = info->dev; | 224 | struct net_device *dev = info->dev; |
@@ -323,12 +321,13 @@ static void ibmtr_config(struct pcmcia_device *link) | |||
323 | for (i = 0; i < TR_ALEN; i++) | 321 | for (i = 0; i < TR_ALEN; i++) |
324 | printk("%02X", dev->dev_addr[i]); | 322 | printk("%02X", dev->dev_addr[i]); |
325 | printk("\n"); | 323 | printk("\n"); |
326 | return; | 324 | return 0; |
327 | 325 | ||
328 | cs_failed: | 326 | cs_failed: |
329 | cs_error(link, last_fn, last_ret); | 327 | cs_error(link, last_fn, last_ret); |
330 | failed: | 328 | failed: |
331 | ibmtr_release(link); | 329 | ibmtr_release(link); |
330 | return -ENODEV; | ||
332 | } /* ibmtr_config */ | 331 | } /* ibmtr_config */ |
333 | 332 | ||
334 | /*====================================================================== | 333 | /*====================================================================== |
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c index 8b8e7162314c..ea8a62e629a4 100644 --- a/drivers/net/pcmcia/nmclan_cs.c +++ b/drivers/net/pcmcia/nmclan_cs.c | |||
@@ -417,7 +417,7 @@ INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG); | |||
417 | Function Prototypes | 417 | Function Prototypes |
418 | ---------------------------------------------------------------------------- */ | 418 | ---------------------------------------------------------------------------- */ |
419 | 419 | ||
420 | static void nmclan_config(struct pcmcia_device *link); | 420 | static int nmclan_config(struct pcmcia_device *link); |
421 | static void nmclan_release(struct pcmcia_device *link); | 421 | static void nmclan_release(struct pcmcia_device *link); |
422 | 422 | ||
423 | static void nmclan_reset(struct net_device *dev); | 423 | static void nmclan_reset(struct net_device *dev); |
@@ -443,7 +443,7 @@ nmclan_attach | |||
443 | Services. | 443 | Services. |
444 | ---------------------------------------------------------------------------- */ | 444 | ---------------------------------------------------------------------------- */ |
445 | 445 | ||
446 | static int nmclan_attach(struct pcmcia_device *link) | 446 | static int nmclan_probe(struct pcmcia_device *link) |
447 | { | 447 | { |
448 | mace_private *lp; | 448 | mace_private *lp; |
449 | struct net_device *dev; | 449 | struct net_device *dev; |
@@ -488,9 +488,7 @@ static int nmclan_attach(struct pcmcia_device *link) | |||
488 | #endif | 488 | #endif |
489 | 489 | ||
490 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 490 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
491 | nmclan_config(link); | 491 | return nmclan_config(link); |
492 | |||
493 | return 0; | ||
494 | } /* nmclan_attach */ | 492 | } /* nmclan_attach */ |
495 | 493 | ||
496 | /* ---------------------------------------------------------------------------- | 494 | /* ---------------------------------------------------------------------------- |
@@ -655,7 +653,7 @@ nmclan_config | |||
655 | #define CS_CHECK(fn, ret) \ | 653 | #define CS_CHECK(fn, ret) \ |
656 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 654 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
657 | 655 | ||
658 | static void nmclan_config(struct pcmcia_device *link) | 656 | static int nmclan_config(struct pcmcia_device *link) |
659 | { | 657 | { |
660 | struct net_device *dev = link->priv; | 658 | struct net_device *dev = link->priv; |
661 | mace_private *lp = netdev_priv(dev); | 659 | mace_private *lp = netdev_priv(dev); |
@@ -710,7 +708,7 @@ static void nmclan_config(struct pcmcia_device *link) | |||
710 | printk(KERN_NOTICE "nmclan_cs: mace id not found: %x %x should" | 708 | printk(KERN_NOTICE "nmclan_cs: mace id not found: %x %x should" |
711 | " be 0x40 0x?9\n", sig[0], sig[1]); | 709 | " be 0x40 0x?9\n", sig[0], sig[1]); |
712 | link->state &= ~DEV_CONFIG_PENDING; | 710 | link->state &= ~DEV_CONFIG_PENDING; |
713 | return; | 711 | return -ENODEV; |
714 | } | 712 | } |
715 | } | 713 | } |
716 | 714 | ||
@@ -740,14 +738,13 @@ static void nmclan_config(struct pcmcia_device *link) | |||
740 | dev->name, dev->base_addr, dev->irq, if_names[dev->if_port]); | 738 | dev->name, dev->base_addr, dev->irq, if_names[dev->if_port]); |
741 | for (i = 0; i < 6; i++) | 739 | for (i = 0; i < 6; i++) |
742 | printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); | 740 | printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); |
743 | return; | 741 | return 0; |
744 | 742 | ||
745 | cs_failed: | 743 | cs_failed: |
746 | cs_error(link, last_fn, last_ret); | 744 | cs_error(link, last_fn, last_ret); |
747 | failed: | 745 | failed: |
748 | nmclan_release(link); | 746 | nmclan_release(link); |
749 | return; | 747 | return -ENODEV; |
750 | |||
751 | } /* nmclan_config */ | 748 | } /* nmclan_config */ |
752 | 749 | ||
753 | /* ---------------------------------------------------------------------------- | 750 | /* ---------------------------------------------------------------------------- |
@@ -1611,7 +1608,7 @@ static struct pcmcia_driver nmclan_cs_driver = { | |||
1611 | .drv = { | 1608 | .drv = { |
1612 | .name = "nmclan_cs", | 1609 | .name = "nmclan_cs", |
1613 | }, | 1610 | }, |
1614 | .probe = nmclan_attach, | 1611 | .probe = nmclan_probe, |
1615 | .remove = nmclan_detach, | 1612 | .remove = nmclan_detach, |
1616 | .id_table = nmclan_ids, | 1613 | .id_table = nmclan_ids, |
1617 | .suspend = nmclan_suspend, | 1614 | .suspend = nmclan_suspend, |
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index 9f41355e6beb..d840c0f03ea9 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
@@ -103,7 +103,7 @@ module_param_array(hw_addr, int, NULL, 0); | |||
103 | /*====================================================================*/ | 103 | /*====================================================================*/ |
104 | 104 | ||
105 | static void mii_phy_probe(struct net_device *dev); | 105 | static void mii_phy_probe(struct net_device *dev); |
106 | static void pcnet_config(struct pcmcia_device *link); | 106 | static int pcnet_config(struct pcmcia_device *link); |
107 | static void pcnet_release(struct pcmcia_device *link); | 107 | static void pcnet_release(struct pcmcia_device *link); |
108 | static int pcnet_open(struct net_device *dev); | 108 | static int pcnet_open(struct net_device *dev); |
109 | static int pcnet_close(struct net_device *dev); | 109 | static int pcnet_close(struct net_device *dev); |
@@ -265,9 +265,7 @@ static int pcnet_probe(struct pcmcia_device *link) | |||
265 | dev->set_config = &set_config; | 265 | dev->set_config = &set_config; |
266 | 266 | ||
267 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 267 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
268 | pcnet_config(link); | 268 | return pcnet_config(link); |
269 | |||
270 | return 0; | ||
271 | } /* pcnet_attach */ | 269 | } /* pcnet_attach */ |
272 | 270 | ||
273 | /*====================================================================== | 271 | /*====================================================================== |
@@ -516,7 +514,7 @@ static int try_io_port(struct pcmcia_device *link) | |||
516 | } | 514 | } |
517 | } | 515 | } |
518 | 516 | ||
519 | static void pcnet_config(struct pcmcia_device *link) | 517 | static int pcnet_config(struct pcmcia_device *link) |
520 | { | 518 | { |
521 | struct net_device *dev = link->priv; | 519 | struct net_device *dev = link->priv; |
522 | pcnet_dev_t *info = PRIV(dev); | 520 | pcnet_dev_t *info = PRIV(dev); |
@@ -701,14 +699,14 @@ static void pcnet_config(struct pcmcia_device *link) | |||
701 | printk(" hw_addr "); | 699 | printk(" hw_addr "); |
702 | for (i = 0; i < 6; i++) | 700 | for (i = 0; i < 6; i++) |
703 | printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); | 701 | printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); |
704 | return; | 702 | return 0; |
705 | 703 | ||
706 | cs_failed: | 704 | cs_failed: |
707 | cs_error(link, last_fn, last_ret); | 705 | cs_error(link, last_fn, last_ret); |
708 | failed: | 706 | failed: |
709 | pcnet_release(link); | 707 | pcnet_release(link); |
710 | link->state &= ~DEV_CONFIG_PENDING; | 708 | link->state &= ~DEV_CONFIG_PENDING; |
711 | return; | 709 | return -ENODEV; |
712 | } /* pcnet_config */ | 710 | } /* pcnet_config */ |
713 | 711 | ||
714 | /*====================================================================== | 712 | /*====================================================================== |
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index a4ee3057b831..3252c1dc9ee7 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c | |||
@@ -279,7 +279,7 @@ enum RxCfg { RxAllMulti = 0x0004, RxPromisc = 0x0002, | |||
279 | /*====================================================================*/ | 279 | /*====================================================================*/ |
280 | 280 | ||
281 | static void smc91c92_detach(struct pcmcia_device *p_dev); | 281 | static void smc91c92_detach(struct pcmcia_device *p_dev); |
282 | static void smc91c92_config(struct pcmcia_device *link); | 282 | static int smc91c92_config(struct pcmcia_device *link); |
283 | static void smc91c92_release(struct pcmcia_device *link); | 283 | static void smc91c92_release(struct pcmcia_device *link); |
284 | 284 | ||
285 | static int smc_open(struct net_device *dev); | 285 | static int smc_open(struct net_device *dev); |
@@ -309,7 +309,7 @@ static struct ethtool_ops ethtool_ops; | |||
309 | 309 | ||
310 | ======================================================================*/ | 310 | ======================================================================*/ |
311 | 311 | ||
312 | static int smc91c92_attach(struct pcmcia_device *link) | 312 | static int smc91c92_probe(struct pcmcia_device *link) |
313 | { | 313 | { |
314 | struct smc_private *smc; | 314 | struct smc_private *smc; |
315 | struct net_device *dev; | 315 | struct net_device *dev; |
@@ -357,9 +357,7 @@ static int smc91c92_attach(struct pcmcia_device *link) | |||
357 | smc->mii_if.reg_num_mask = 0x1f; | 357 | smc->mii_if.reg_num_mask = 0x1f; |
358 | 358 | ||
359 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 359 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
360 | smc91c92_config(link); | 360 | return smc91c92_config(link); |
361 | |||
362 | return 0; | ||
363 | } /* smc91c92_attach */ | 361 | } /* smc91c92_attach */ |
364 | 362 | ||
365 | /*====================================================================== | 363 | /*====================================================================== |
@@ -972,7 +970,7 @@ static int check_sig(struct pcmcia_device *link) | |||
972 | #define CS_EXIT_TEST(ret, svc, label) \ | 970 | #define CS_EXIT_TEST(ret, svc, label) \ |
973 | if (ret != CS_SUCCESS) { cs_error(link, svc, ret); goto label; } | 971 | if (ret != CS_SUCCESS) { cs_error(link, svc, ret); goto label; } |
974 | 972 | ||
975 | static void smc91c92_config(struct pcmcia_device *link) | 973 | static int smc91c92_config(struct pcmcia_device *link) |
976 | { | 974 | { |
977 | struct net_device *dev = link->priv; | 975 | struct net_device *dev = link->priv; |
978 | struct smc_private *smc = netdev_priv(dev); | 976 | struct smc_private *smc = netdev_priv(dev); |
@@ -1145,7 +1143,7 @@ static void smc91c92_config(struct pcmcia_device *link) | |||
1145 | } | 1143 | } |
1146 | } | 1144 | } |
1147 | kfree(cfg_mem); | 1145 | kfree(cfg_mem); |
1148 | return; | 1146 | return 0; |
1149 | 1147 | ||
1150 | config_undo: | 1148 | config_undo: |
1151 | unregister_netdev(dev); | 1149 | unregister_netdev(dev); |
@@ -1153,7 +1151,7 @@ config_failed: /* CS_EXIT_TEST() calls jump to here... */ | |||
1153 | smc91c92_release(link); | 1151 | smc91c92_release(link); |
1154 | link->state &= ~DEV_CONFIG_PENDING; | 1152 | link->state &= ~DEV_CONFIG_PENDING; |
1155 | kfree(cfg_mem); | 1153 | kfree(cfg_mem); |
1156 | 1154 | return -ENODEV; | |
1157 | } /* smc91c92_config */ | 1155 | } /* smc91c92_config */ |
1158 | 1156 | ||
1159 | /*====================================================================== | 1157 | /*====================================================================== |
@@ -2289,7 +2287,7 @@ static struct pcmcia_driver smc91c92_cs_driver = { | |||
2289 | .drv = { | 2287 | .drv = { |
2290 | .name = "smc91c92_cs", | 2288 | .name = "smc91c92_cs", |
2291 | }, | 2289 | }, |
2292 | .probe = smc91c92_attach, | 2290 | .probe = smc91c92_probe, |
2293 | .remove = smc91c92_detach, | 2291 | .remove = smc91c92_detach, |
2294 | .id_table = smc91c92_ids, | 2292 | .id_table = smc91c92_ids, |
2295 | .suspend = smc91c92_suspend, | 2293 | .suspend = smc91c92_suspend, |
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index 84328da075c3..77bf4e3a6139 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c | |||
@@ -290,7 +290,7 @@ static void mii_wr(kio_addr_t ioaddr, u_char phyaddr, u_char phyreg, | |||
290 | */ | 290 | */ |
291 | 291 | ||
292 | static int has_ce2_string(struct pcmcia_device * link); | 292 | static int has_ce2_string(struct pcmcia_device * link); |
293 | static void xirc2ps_config(struct pcmcia_device * link); | 293 | static int xirc2ps_config(struct pcmcia_device * link); |
294 | static void xirc2ps_release(struct pcmcia_device * link); | 294 | static void xirc2ps_release(struct pcmcia_device * link); |
295 | 295 | ||
296 | /**************** | 296 | /**************** |
@@ -553,7 +553,7 @@ mii_wr(kio_addr_t ioaddr, u_char phyaddr, u_char phyreg, unsigned data, int len) | |||
553 | */ | 553 | */ |
554 | 554 | ||
555 | static int | 555 | static int |
556 | xirc2ps_attach(struct pcmcia_device *link) | 556 | xirc2ps_probe(struct pcmcia_device *link) |
557 | { | 557 | { |
558 | struct net_device *dev; | 558 | struct net_device *dev; |
559 | local_info_t *local; | 559 | local_info_t *local; |
@@ -592,9 +592,7 @@ xirc2ps_attach(struct pcmcia_device *link) | |||
592 | #endif | 592 | #endif |
593 | 593 | ||
594 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 594 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
595 | xirc2ps_config(link); | 595 | return xirc2ps_config(link); |
596 | |||
597 | return 0; | ||
598 | } /* xirc2ps_attach */ | 596 | } /* xirc2ps_attach */ |
599 | 597 | ||
600 | /**************** | 598 | /**************** |
@@ -731,7 +729,7 @@ has_ce2_string(struct pcmcia_device * link) | |||
731 | * is received, to configure the PCMCIA socket, and to make the | 729 | * is received, to configure the PCMCIA socket, and to make the |
732 | * ethernet device available to the system. | 730 | * ethernet device available to the system. |
733 | */ | 731 | */ |
734 | static void | 732 | static int |
735 | xirc2ps_config(struct pcmcia_device * link) | 733 | xirc2ps_config(struct pcmcia_device * link) |
736 | { | 734 | { |
737 | struct net_device *dev = link->priv; | 735 | struct net_device *dev = link->priv; |
@@ -1061,17 +1059,18 @@ xirc2ps_config(struct pcmcia_device * link) | |||
1061 | printk("%c%02X", i?':':' ', dev->dev_addr[i]); | 1059 | printk("%c%02X", i?':':' ', dev->dev_addr[i]); |
1062 | printk("\n"); | 1060 | printk("\n"); |
1063 | 1061 | ||
1064 | return; | 1062 | return 0; |
1065 | 1063 | ||
1066 | config_error: | 1064 | config_error: |
1067 | link->state &= ~DEV_CONFIG_PENDING; | 1065 | link->state &= ~DEV_CONFIG_PENDING; |
1068 | xirc2ps_release(link); | 1066 | xirc2ps_release(link); |
1069 | return; | 1067 | return -ENODEV; |
1070 | 1068 | ||
1071 | cis_error: | 1069 | cis_error: |
1072 | printk(KNOT_XIRC "unable to parse CIS\n"); | 1070 | printk(KNOT_XIRC "unable to parse CIS\n"); |
1073 | failure: | 1071 | failure: |
1074 | link->state &= ~DEV_CONFIG_PENDING; | 1072 | link->state &= ~DEV_CONFIG_PENDING; |
1073 | return -ENODEV; | ||
1075 | } /* xirc2ps_config */ | 1074 | } /* xirc2ps_config */ |
1076 | 1075 | ||
1077 | /**************** | 1076 | /**************** |
@@ -1911,7 +1910,7 @@ static struct pcmcia_driver xirc2ps_cs_driver = { | |||
1911 | .drv = { | 1910 | .drv = { |
1912 | .name = "xirc2ps_cs", | 1911 | .name = "xirc2ps_cs", |
1913 | }, | 1912 | }, |
1914 | .probe = xirc2ps_attach, | 1913 | .probe = xirc2ps_probe, |
1915 | .remove = xirc2ps_detach, | 1914 | .remove = xirc2ps_detach, |
1916 | .id_table = xirc2ps_ids, | 1915 | .id_table = xirc2ps_ids, |
1917 | .suspend = xirc2ps_suspend, | 1916 | .suspend = xirc2ps_suspend, |
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, |
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c index 843dd1a036d2..962272c1342a 100644 --- a/drivers/net/wireless/atmel_cs.c +++ b/drivers/net/wireless/atmel_cs.c | |||
@@ -91,7 +91,7 @@ MODULE_SUPPORTED_DEVICE("Atmel at76c50x PCMCIA cards"); | |||
91 | event handler. | 91 | event handler. |
92 | */ | 92 | */ |
93 | 93 | ||
94 | static void atmel_config(struct pcmcia_device *link); | 94 | static int atmel_config(struct pcmcia_device *link); |
95 | static void atmel_release(struct pcmcia_device *link); | 95 | static void atmel_release(struct pcmcia_device *link); |
96 | 96 | ||
97 | /* | 97 | /* |
@@ -152,7 +152,7 @@ typedef struct local_info_t { | |||
152 | 152 | ||
153 | ======================================================================*/ | 153 | ======================================================================*/ |
154 | 154 | ||
155 | static int atmel_attach(struct pcmcia_device *p_dev) | 155 | static int atmel_probe(struct pcmcia_device *p_dev) |
156 | { | 156 | { |
157 | local_info_t *local; | 157 | local_info_t *local; |
158 | 158 | ||
@@ -182,9 +182,7 @@ static int atmel_attach(struct pcmcia_device *p_dev) | |||
182 | p_dev->priv = local; | 182 | p_dev->priv = local; |
183 | 183 | ||
184 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 184 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
185 | atmel_config(p_dev); | 185 | return atmel_config(p_dev); |
186 | |||
187 | return 0; | ||
188 | } /* atmel_attach */ | 186 | } /* atmel_attach */ |
189 | 187 | ||
190 | /*====================================================================== | 188 | /*====================================================================== |
@@ -230,7 +228,7 @@ static int card_present(void *arg) | |||
230 | return 0; | 228 | return 0; |
231 | } | 229 | } |
232 | 230 | ||
233 | static void atmel_config(struct pcmcia_device *link) | 231 | static int atmel_config(struct pcmcia_device *link) |
234 | { | 232 | { |
235 | tuple_t tuple; | 233 | tuple_t tuple; |
236 | cisparse_t parse; | 234 | cisparse_t parse; |
@@ -377,11 +375,12 @@ static void atmel_config(struct pcmcia_device *link) | |||
377 | link->dev_node = &dev->node; | 375 | link->dev_node = &dev->node; |
378 | 376 | ||
379 | link->state &= ~DEV_CONFIG_PENDING; | 377 | link->state &= ~DEV_CONFIG_PENDING; |
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 | atmel_release(link); | 382 | atmel_release(link); |
383 | return -ENODEV; | ||
385 | } | 384 | } |
386 | 385 | ||
387 | /*====================================================================== | 386 | /*====================================================================== |
@@ -476,7 +475,7 @@ static struct pcmcia_driver atmel_driver = { | |||
476 | .drv = { | 475 | .drv = { |
477 | .name = "atmel_cs", | 476 | .name = "atmel_cs", |
478 | }, | 477 | }, |
479 | .probe = atmel_attach, | 478 | .probe = atmel_probe, |
480 | .remove = atmel_detach, | 479 | .remove = atmel_detach, |
481 | .id_table = atmel_ids, | 480 | .id_table = atmel_ids, |
482 | .suspend = atmel_suspend, | 481 | .suspend = atmel_suspend, |
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c index 89b178106edf..88dc383a3da7 100644 --- a/drivers/net/wireless/hostap/hostap_cs.c +++ b/drivers/net/wireless/hostap/hostap_cs.c | |||
@@ -501,16 +501,20 @@ static struct prism2_helper_functions prism2_pccard_funcs = | |||
501 | 501 | ||
502 | /* allocate local data and register with CardServices | 502 | /* allocate local data and register with CardServices |
503 | * initialize dev_link structure, but do not configure the card yet */ | 503 | * initialize dev_link structure, but do not configure the card yet */ |
504 | static int prism2_attach(struct pcmcia_device *p_dev) | 504 | static int hostap_cs_probe(struct pcmcia_device *p_dev) |
505 | { | 505 | { |
506 | int ret; | ||
507 | |||
506 | PDEBUG(DEBUG_HW, "%s: setting Vcc=33 (constant)\n", dev_info); | 508 | PDEBUG(DEBUG_HW, "%s: setting Vcc=33 (constant)\n", dev_info); |
507 | p_dev->conf.IntType = INT_MEMORY_AND_IO; | 509 | p_dev->conf.IntType = INT_MEMORY_AND_IO; |
508 | 510 | ||
509 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 511 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
510 | if (prism2_config(p_dev)) | 512 | ret = prism2_config(p_dev); |
513 | if (ret) { | ||
511 | PDEBUG(DEBUG_EXTRA, "prism2_config() failed\n"); | 514 | PDEBUG(DEBUG_EXTRA, "prism2_config() failed\n"); |
515 | } | ||
512 | 516 | ||
513 | return 0; | 517 | return ret; |
514 | } | 518 | } |
515 | 519 | ||
516 | 520 | ||
@@ -894,7 +898,7 @@ static struct pcmcia_driver hostap_driver = { | |||
894 | .drv = { | 898 | .drv = { |
895 | .name = "hostap_cs", | 899 | .name = "hostap_cs", |
896 | }, | 900 | }, |
897 | .probe = prism2_attach, | 901 | .probe = hostap_cs_probe, |
898 | .remove = prism2_detach, | 902 | .remove = prism2_detach, |
899 | .owner = THIS_MODULE, | 903 | .owner = THIS_MODULE, |
900 | .id_table = hostap_cs_ids, | 904 | .id_table = hostap_cs_ids, |
diff --git a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c index 2a688865f777..2689f3bbc889 100644 --- a/drivers/net/wireless/netwave_cs.c +++ b/drivers/net/wireless/netwave_cs.c | |||
@@ -191,7 +191,7 @@ module_param(mem_speed, int, 0); | |||
191 | 191 | ||
192 | /* PCMCIA (Card Services) related functions */ | 192 | /* PCMCIA (Card Services) related functions */ |
193 | static void netwave_release(struct pcmcia_device *link); /* Card removal */ | 193 | static void netwave_release(struct pcmcia_device *link); /* Card removal */ |
194 | static void netwave_pcmcia_config(struct pcmcia_device *arg); /* Runs after card | 194 | static int netwave_pcmcia_config(struct pcmcia_device *arg); /* Runs after card |
195 | insertion */ | 195 | insertion */ |
196 | static void netwave_detach(struct pcmcia_device *p_dev); /* Destroy instance */ | 196 | static void netwave_detach(struct pcmcia_device *p_dev); /* Destroy instance */ |
197 | 197 | ||
@@ -376,7 +376,7 @@ static struct iw_statistics *netwave_get_wireless_stats(struct net_device *dev) | |||
376 | * configure the card at this point -- we wait until we receive a | 376 | * configure the card at this point -- we wait until we receive a |
377 | * card insertion event. | 377 | * card insertion event. |
378 | */ | 378 | */ |
379 | static int netwave_attach(struct pcmcia_device *link) | 379 | static int netwave_probe(struct pcmcia_device *link) |
380 | { | 380 | { |
381 | struct net_device *dev; | 381 | struct net_device *dev; |
382 | netwave_private *priv; | 382 | netwave_private *priv; |
@@ -429,9 +429,7 @@ static int netwave_attach(struct pcmcia_device *link) | |||
429 | link->irq.Instance = dev; | 429 | link->irq.Instance = dev; |
430 | 430 | ||
431 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 431 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
432 | netwave_pcmcia_config( link); | 432 | return netwave_pcmcia_config( link); |
433 | |||
434 | return 0; | ||
435 | } /* netwave_attach */ | 433 | } /* netwave_attach */ |
436 | 434 | ||
437 | /* | 435 | /* |
@@ -737,7 +735,7 @@ static const struct iw_handler_def netwave_handler_def = | |||
737 | #define CS_CHECK(fn, ret) \ | 735 | #define CS_CHECK(fn, ret) \ |
738 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 736 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
739 | 737 | ||
740 | static void netwave_pcmcia_config(struct pcmcia_device *link) { | 738 | static int netwave_pcmcia_config(struct pcmcia_device *link) { |
741 | struct net_device *dev = link->priv; | 739 | struct net_device *dev = link->priv; |
742 | netwave_private *priv = netdev_priv(dev); | 740 | netwave_private *priv = netdev_priv(dev); |
743 | tuple_t tuple; | 741 | tuple_t tuple; |
@@ -845,12 +843,13 @@ static void netwave_pcmcia_config(struct pcmcia_device *link) { | |||
845 | printk(KERN_DEBUG "Netwave_reset: revision %04x %04x\n", | 843 | printk(KERN_DEBUG "Netwave_reset: revision %04x %04x\n", |
846 | get_uint16(ramBase + NETWAVE_EREG_ARW), | 844 | get_uint16(ramBase + NETWAVE_EREG_ARW), |
847 | get_uint16(ramBase + NETWAVE_EREG_ARW+2)); | 845 | get_uint16(ramBase + NETWAVE_EREG_ARW+2)); |
848 | return; | 846 | return 0; |
849 | 847 | ||
850 | cs_failed: | 848 | cs_failed: |
851 | cs_error(link, last_fn, last_ret); | 849 | cs_error(link, last_fn, last_ret); |
852 | failed: | 850 | failed: |
853 | netwave_release(link); | 851 | netwave_release(link); |
852 | return -ENODEV; | ||
854 | } /* netwave_pcmcia_config */ | 853 | } /* netwave_pcmcia_config */ |
855 | 854 | ||
856 | /* | 855 | /* |
@@ -1387,7 +1386,7 @@ static struct pcmcia_driver netwave_driver = { | |||
1387 | .drv = { | 1386 | .drv = { |
1388 | .name = "netwave_cs", | 1387 | .name = "netwave_cs", |
1389 | }, | 1388 | }, |
1390 | .probe = netwave_attach, | 1389 | .probe = netwave_probe, |
1391 | .remove = netwave_detach, | 1390 | .remove = netwave_detach, |
1392 | .id_table = netwave_ids, | 1391 | .id_table = netwave_ids, |
1393 | .suspend = netwave_suspend, | 1392 | .suspend = netwave_suspend, |
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, |
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 415ae8be1e22..8cfe9332a3c1 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c | |||
@@ -90,7 +90,7 @@ module_param(pc_debug, int, 0); | |||
90 | #define DEBUG(n, args...) | 90 | #define DEBUG(n, args...) |
91 | #endif | 91 | #endif |
92 | /** Prototypes based on PCMCIA skeleton driver *******************************/ | 92 | /** Prototypes based on PCMCIA skeleton driver *******************************/ |
93 | static void ray_config(struct pcmcia_device *link); | 93 | static int ray_config(struct pcmcia_device *link); |
94 | static void ray_release(struct pcmcia_device *link); | 94 | static void ray_release(struct pcmcia_device *link); |
95 | static void ray_detach(struct pcmcia_device *p_dev); | 95 | static void ray_detach(struct pcmcia_device *p_dev); |
96 | 96 | ||
@@ -303,7 +303,7 @@ static char rcsid[] = "Raylink/WebGear wireless LAN - Corey <Thomas corey@world. | |||
303 | configure the card at this point -- we wait until we receive a | 303 | configure the card at this point -- we wait until we receive a |
304 | card insertion event. | 304 | card insertion event. |
305 | =============================================================================*/ | 305 | =============================================================================*/ |
306 | static int ray_attach(struct pcmcia_device *p_dev) | 306 | static int ray_probe(struct pcmcia_device *p_dev) |
307 | { | 307 | { |
308 | ray_dev_t *local; | 308 | ray_dev_t *local; |
309 | struct net_device *dev; | 309 | struct net_device *dev; |
@@ -368,9 +368,7 @@ static int ray_attach(struct pcmcia_device *p_dev) | |||
368 | 368 | ||
369 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 369 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
370 | this_device = p_dev; | 370 | this_device = p_dev; |
371 | ray_config(p_dev); | 371 | return ray_config(p_dev); |
372 | |||
373 | return 0; | ||
374 | 372 | ||
375 | fail_alloc_dev: | 373 | fail_alloc_dev: |
376 | return -ENOMEM; | 374 | return -ENOMEM; |
@@ -412,7 +410,7 @@ static void ray_detach(struct pcmcia_device *link) | |||
412 | #define CS_CHECK(fn, ret) \ | 410 | #define CS_CHECK(fn, ret) \ |
413 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 411 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
414 | #define MAX_TUPLE_SIZE 128 | 412 | #define MAX_TUPLE_SIZE 128 |
415 | static void ray_config(struct pcmcia_device *link) | 413 | static int ray_config(struct pcmcia_device *link) |
416 | { | 414 | { |
417 | tuple_t tuple; | 415 | tuple_t tuple; |
418 | cisparse_t parse; | 416 | cisparse_t parse; |
@@ -499,7 +497,7 @@ static void ray_config(struct pcmcia_device *link) | |||
499 | DEBUG(3,"ray_config amem=%p\n",local->amem); | 497 | DEBUG(3,"ray_config amem=%p\n",local->amem); |
500 | if (ray_init(dev) < 0) { | 498 | if (ray_init(dev) < 0) { |
501 | ray_release(link); | 499 | ray_release(link); |
502 | return; | 500 | return -ENODEV; |
503 | } | 501 | } |
504 | 502 | ||
505 | SET_NETDEV_DEV(dev, &handle_to_dev(link)); | 503 | SET_NETDEV_DEV(dev, &handle_to_dev(link)); |
@@ -507,7 +505,7 @@ static void ray_config(struct pcmcia_device *link) | |||
507 | if (i != 0) { | 505 | if (i != 0) { |
508 | printk("ray_config register_netdev() failed\n"); | 506 | printk("ray_config register_netdev() failed\n"); |
509 | ray_release(link); | 507 | ray_release(link); |
510 | return; | 508 | return i; |
511 | } | 509 | } |
512 | 510 | ||
513 | strcpy(local->node.dev_name, dev->name); | 511 | strcpy(local->node.dev_name, dev->name); |
@@ -519,12 +517,13 @@ static void ray_config(struct pcmcia_device *link) | |||
519 | for (i = 0; i < 6; i++) | 517 | for (i = 0; i < 6; i++) |
520 | printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); | 518 | printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); |
521 | 519 | ||
522 | return; | 520 | return 0; |
523 | 521 | ||
524 | cs_failed: | 522 | cs_failed: |
525 | cs_error(link, last_fn, last_ret); | 523 | cs_error(link, last_fn, last_ret); |
526 | 524 | ||
527 | ray_release(link); | 525 | ray_release(link); |
526 | return -ENODEV; | ||
528 | } /* ray_config */ | 527 | } /* ray_config */ |
529 | 528 | ||
530 | static inline struct ccs __iomem *ccs_base(ray_dev_t *dev) | 529 | static inline struct ccs __iomem *ccs_base(ray_dev_t *dev) |
@@ -2846,7 +2845,7 @@ static struct pcmcia_driver ray_driver = { | |||
2846 | .drv = { | 2845 | .drv = { |
2847 | .name = "ray_cs", | 2846 | .name = "ray_cs", |
2848 | }, | 2847 | }, |
2849 | .probe = ray_attach, | 2848 | .probe = ray_probe, |
2850 | .remove = ray_detach, | 2849 | .remove = ray_detach, |
2851 | .id_table = ray_ids, | 2850 | .id_table = ray_ids, |
2852 | .suspend = ray_suspend, | 2851 | .suspend = ray_suspend, |
diff --git a/drivers/net/wireless/spectrum_cs.c b/drivers/net/wireless/spectrum_cs.c index a75ea7e593ac..118b2c6e5a29 100644 --- a/drivers/net/wireless/spectrum_cs.c +++ b/drivers/net/wireless/spectrum_cs.c | |||
@@ -71,7 +71,7 @@ struct orinoco_pccard { | |||
71 | /* Function prototypes */ | 71 | /* Function prototypes */ |
72 | /********************************************************************/ | 72 | /********************************************************************/ |
73 | 73 | ||
74 | static void spectrum_cs_config(struct pcmcia_device *link); | 74 | static int spectrum_cs_config(struct pcmcia_device *link); |
75 | static void spectrum_cs_release(struct pcmcia_device *link); | 75 | static void spectrum_cs_release(struct pcmcia_device *link); |
76 | 76 | ||
77 | /********************************************************************/ | 77 | /********************************************************************/ |
@@ -583,7 +583,7 @@ spectrum_cs_hard_reset(struct orinoco_private *priv) | |||
583 | * configure the card at this point -- we wait until we receive a card | 583 | * configure the card at this point -- we wait until we receive a card |
584 | * insertion event. */ | 584 | * insertion event. */ |
585 | static int | 585 | static int |
586 | spectrum_cs_attach(struct pcmcia_device *link) | 586 | spectrum_cs_probe(struct pcmcia_device *link) |
587 | { | 587 | { |
588 | struct net_device *dev; | 588 | struct net_device *dev; |
589 | struct orinoco_private *priv; | 589 | struct orinoco_private *priv; |
@@ -614,9 +614,7 @@ spectrum_cs_attach(struct pcmcia_device *link) | |||
614 | link->conf.IntType = INT_MEMORY_AND_IO; | 614 | link->conf.IntType = INT_MEMORY_AND_IO; |
615 | 615 | ||
616 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 616 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
617 | spectrum_cs_config(link); | 617 | return spectrum_cs_config(link); |
618 | |||
619 | return 0; | ||
620 | } /* spectrum_cs_attach */ | 618 | } /* spectrum_cs_attach */ |
621 | 619 | ||
622 | /* | 620 | /* |
@@ -647,7 +645,7 @@ static void spectrum_cs_detach(struct pcmcia_device *link) | |||
647 | * device available to the system. | 645 | * device available to the system. |
648 | */ | 646 | */ |
649 | 647 | ||
650 | static void | 648 | static int |
651 | spectrum_cs_config(struct pcmcia_device *link) | 649 | spectrum_cs_config(struct pcmcia_device *link) |
652 | { | 650 | { |
653 | struct net_device *dev = link->priv; | 651 | struct net_device *dev = link->priv; |
@@ -857,13 +855,14 @@ spectrum_cs_config(struct pcmcia_device *link) | |||
857 | link->io.BasePort2 + link->io.NumPorts2 - 1); | 855 | link->io.BasePort2 + link->io.NumPorts2 - 1); |
858 | printk("\n"); | 856 | printk("\n"); |
859 | 857 | ||
860 | return; | 858 | return 0; |
861 | 859 | ||
862 | cs_failed: | 860 | cs_failed: |
863 | cs_error(link, last_fn, last_ret); | 861 | cs_error(link, last_fn, last_ret); |
864 | 862 | ||
865 | failed: | 863 | failed: |
866 | spectrum_cs_release(link); | 864 | spectrum_cs_release(link); |
865 | return -ENODEV; | ||
867 | } /* spectrum_cs_config */ | 866 | } /* spectrum_cs_config */ |
868 | 867 | ||
869 | /* | 868 | /* |
@@ -954,7 +953,7 @@ static struct pcmcia_driver orinoco_driver = { | |||
954 | .drv = { | 953 | .drv = { |
955 | .name = DRIVER_NAME, | 954 | .name = DRIVER_NAME, |
956 | }, | 955 | }, |
957 | .probe = spectrum_cs_attach, | 956 | .probe = spectrum_cs_probe, |
958 | .remove = spectrum_cs_detach, | 957 | .remove = spectrum_cs_detach, |
959 | .suspend = spectrum_cs_suspend, | 958 | .suspend = spectrum_cs_suspend, |
960 | .resume = spectrum_cs_resume, | 959 | .resume = spectrum_cs_resume, |
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c index 352d4a50b799..7373caf6e8e8 100644 --- a/drivers/net/wireless/wavelan_cs.c +++ b/drivers/net/wireless/wavelan_cs.c | |||
@@ -4580,10 +4580,11 @@ wavelan_close(struct net_device * dev) | |||
4580 | * card insertion event. | 4580 | * card insertion event. |
4581 | */ | 4581 | */ |
4582 | static int | 4582 | static int |
4583 | wavelan_attach(struct pcmcia_device *p_dev) | 4583 | wavelan_probe(struct pcmcia_device *p_dev) |
4584 | { | 4584 | { |
4585 | struct net_device * dev; /* Interface generic data */ | 4585 | struct net_device * dev; /* Interface generic data */ |
4586 | net_local * lp; /* Interface specific data */ | 4586 | net_local * lp; /* Interface specific data */ |
4587 | int ret; | ||
4587 | 4588 | ||
4588 | #ifdef DEBUG_CALLBACK_TRACE | 4589 | #ifdef DEBUG_CALLBACK_TRACE |
4589 | printk(KERN_DEBUG "-> wavelan_attach()\n"); | 4590 | printk(KERN_DEBUG "-> wavelan_attach()\n"); |
@@ -4651,11 +4652,18 @@ wavelan_attach(struct pcmcia_device *p_dev) | |||
4651 | dev->mtu = WAVELAN_MTU; | 4652 | dev->mtu = WAVELAN_MTU; |
4652 | 4653 | ||
4653 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 4654 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
4654 | if(wv_pcmcia_config(p_dev) && | 4655 | ret = wv_pcmcia_config(p_dev); |
4655 | wv_hw_config(dev)) | 4656 | if (ret) |
4656 | wv_init_info(dev); | 4657 | return ret; |
4657 | else | 4658 | |
4659 | ret = wv_hw_config(dev); | ||
4660 | if (ret) { | ||
4658 | dev->irq = 0; | 4661 | dev->irq = 0; |
4662 | pcmcia_disable_device(p_dev); | ||
4663 | return ret; | ||
4664 | } | ||
4665 | |||
4666 | wv_init_info(dev); | ||
4659 | 4667 | ||
4660 | #ifdef DEBUG_CALLBACK_TRACE | 4668 | #ifdef DEBUG_CALLBACK_TRACE |
4661 | printk(KERN_DEBUG "<- wavelan_attach()\n"); | 4669 | printk(KERN_DEBUG "<- wavelan_attach()\n"); |
@@ -4760,7 +4768,7 @@ static struct pcmcia_driver wavelan_driver = { | |||
4760 | .drv = { | 4768 | .drv = { |
4761 | .name = "wavelan_cs", | 4769 | .name = "wavelan_cs", |
4762 | }, | 4770 | }, |
4763 | .probe = wavelan_attach, | 4771 | .probe = wavelan_probe, |
4764 | .remove = wavelan_detach, | 4772 | .remove = wavelan_detach, |
4765 | .id_table = wavelan_ids, | 4773 | .id_table = wavelan_ids, |
4766 | .suspend = wavelan_suspend, | 4774 | .suspend = wavelan_suspend, |
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c index 752d22260080..6b3a605897bd 100644 --- a/drivers/net/wireless/wl3501_cs.c +++ b/drivers/net/wireless/wl3501_cs.c | |||
@@ -103,7 +103,7 @@ module_param(pc_debug, int, 0); | |||
103 | * release a socket, in response to card insertion and ejection events. They | 103 | * release a socket, in response to card insertion and ejection events. They |
104 | * are invoked from the wl24 event handler. | 104 | * are invoked from the wl24 event handler. |
105 | */ | 105 | */ |
106 | static void wl3501_config(struct pcmcia_device *link); | 106 | static int wl3501_config(struct pcmcia_device *link); |
107 | static void wl3501_release(struct pcmcia_device *link); | 107 | static void wl3501_release(struct pcmcia_device *link); |
108 | 108 | ||
109 | /* | 109 | /* |
@@ -1920,7 +1920,7 @@ static const struct iw_handler_def wl3501_handler_def = { | |||
1920 | * The dev_link structure is initialized, but we don't actually configure the | 1920 | * The dev_link structure is initialized, but we don't actually configure the |
1921 | * card at this point -- we wait until we receive a card insertion event. | 1921 | * card at this point -- we wait until we receive a card insertion event. |
1922 | */ | 1922 | */ |
1923 | static int wl3501_attach(struct pcmcia_device *p_dev) | 1923 | static int wl3501_probe(struct pcmcia_device *p_dev) |
1924 | { | 1924 | { |
1925 | struct net_device *dev; | 1925 | struct net_device *dev; |
1926 | struct wl3501_card *this; | 1926 | struct wl3501_card *this; |
@@ -1960,9 +1960,7 @@ static int wl3501_attach(struct pcmcia_device *p_dev) | |||
1960 | p_dev->priv = p_dev->irq.Instance = dev; | 1960 | p_dev->priv = p_dev->irq.Instance = dev; |
1961 | 1961 | ||
1962 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 1962 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
1963 | wl3501_config(p_dev); | 1963 | return wl3501_config(p_dev); |
1964 | |||
1965 | return 0; | ||
1966 | out_link: | 1964 | out_link: |
1967 | return -ENOMEM; | 1965 | return -ENOMEM; |
1968 | } | 1966 | } |
@@ -1978,7 +1976,7 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | |||
1978 | * received, to configure the PCMCIA socket, and to make the ethernet device | 1976 | * received, to configure the PCMCIA socket, and to make the ethernet device |
1979 | * available to the system. | 1977 | * available to the system. |
1980 | */ | 1978 | */ |
1981 | static void wl3501_config(struct pcmcia_device *link) | 1979 | static int wl3501_config(struct pcmcia_device *link) |
1982 | { | 1980 | { |
1983 | tuple_t tuple; | 1981 | tuple_t tuple; |
1984 | cisparse_t parse; | 1982 | cisparse_t parse; |
@@ -2082,13 +2080,13 @@ static void wl3501_config(struct pcmcia_device *link) | |||
2082 | spin_lock_init(&this->lock); | 2080 | spin_lock_init(&this->lock); |
2083 | init_waitqueue_head(&this->wait); | 2081 | init_waitqueue_head(&this->wait); |
2084 | netif_start_queue(dev); | 2082 | netif_start_queue(dev); |
2085 | goto out; | 2083 | return 0; |
2084 | |||
2086 | cs_failed: | 2085 | cs_failed: |
2087 | cs_error(link, last_fn, last_ret); | 2086 | cs_error(link, last_fn, last_ret); |
2088 | failed: | 2087 | failed: |
2089 | wl3501_release(link); | 2088 | wl3501_release(link); |
2090 | out: | 2089 | return -ENODEV; |
2091 | return; | ||
2092 | } | 2090 | } |
2093 | 2091 | ||
2094 | /** | 2092 | /** |
@@ -2146,7 +2144,7 @@ static struct pcmcia_driver wl3501_driver = { | |||
2146 | .drv = { | 2144 | .drv = { |
2147 | .name = "wl3501_cs", | 2145 | .name = "wl3501_cs", |
2148 | }, | 2146 | }, |
2149 | .probe = wl3501_attach, | 2147 | .probe = wl3501_probe, |
2150 | .remove = wl3501_detach, | 2148 | .remove = wl3501_detach, |
2151 | .id_table = wl3501_ids, | 2149 | .id_table = wl3501_ids, |
2152 | .suspend = wl3501_suspend, | 2150 | .suspend = wl3501_suspend, |