aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:26:06 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:26:06 -0500
commit15b99ac1729503db9e6dc642a50b9b6cb3bf51f9 (patch)
treecfb8897487beba502aac2b28bc35066a87e34299 /drivers/net/wireless
parentfba395eee7d3f342ca739c20f5b3ee635d0420a0 (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')
-rw-r--r--drivers/net/wireless/airo_cs.c18
-rw-r--r--drivers/net/wireless/atmel_cs.c15
-rw-r--r--drivers/net/wireless/hostap/hostap_cs.c12
-rw-r--r--drivers/net/wireless/netwave_cs.c15
-rw-r--r--drivers/net/wireless/orinoco_cs.c15
-rw-r--r--drivers/net/wireless/ray_cs.c19
-rw-r--r--drivers/net/wireless/spectrum_cs.c15
-rw-r--r--drivers/net/wireless/wavelan_cs.c20
-rw-r--r--drivers/net/wireless/wl3501_cs.c18
9 files changed, 75 insertions, 72 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
83static void airo_config(struct pcmcia_device *link); 83static int airo_config(struct pcmcia_device *link);
84static void airo_release(struct pcmcia_device *link); 84static 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
144static int airo_attach(struct pcmcia_device *p_dev) 144static 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) \
212do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 210do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
213 211
214static void airo_config(struct pcmcia_device *link) 212static 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
94static void atmel_config(struct pcmcia_device *link); 94static int atmel_config(struct pcmcia_device *link);
95static void atmel_release(struct pcmcia_device *link); 95static 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
155static int atmel_attach(struct pcmcia_device *p_dev) 155static 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
233static void atmel_config(struct pcmcia_device *link) 231static 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 */
504static int prism2_attach(struct pcmcia_device *p_dev) 504static 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 */
193static void netwave_release(struct pcmcia_device *link); /* Card removal */ 193static void netwave_release(struct pcmcia_device *link); /* Card removal */
194static void netwave_pcmcia_config(struct pcmcia_device *arg); /* Runs after card 194static int netwave_pcmcia_config(struct pcmcia_device *arg); /* Runs after card
195 insertion */ 195 insertion */
196static void netwave_detach(struct pcmcia_device *p_dev); /* Destroy instance */ 196static 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 */
379static int netwave_attach(struct pcmcia_device *link) 379static 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) \
738do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 736do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
739 737
740static void netwave_pcmcia_config(struct pcmcia_device *link) { 738static 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
850cs_failed: 848cs_failed:
851 cs_error(link, last_fn, last_ret); 849 cs_error(link, last_fn, last_ret);
852failed: 850failed:
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
66static void orinoco_cs_config(struct pcmcia_device *link); 66static int orinoco_cs_config(struct pcmcia_device *link);
67static void orinoco_cs_release(struct pcmcia_device *link); 67static void orinoco_cs_release(struct pcmcia_device *link);
68static void orinoco_cs_detach(struct pcmcia_device *p_dev); 68static 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. */
106static int 106static int
107orinoco_cs_attach(struct pcmcia_device *link) 107orinoco_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
175static void 173static int
176orinoco_cs_config(struct pcmcia_device *link) 174orinoco_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 *******************************/
93static void ray_config(struct pcmcia_device *link); 93static int ray_config(struct pcmcia_device *link);
94static void ray_release(struct pcmcia_device *link); 94static void ray_release(struct pcmcia_device *link);
95static void ray_detach(struct pcmcia_device *p_dev); 95static 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=============================================================================*/
306static int ray_attach(struct pcmcia_device *p_dev) 306static 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
375fail_alloc_dev: 373fail_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) \
413do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 411do { 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
415static void ray_config(struct pcmcia_device *link) 413static 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
524cs_failed: 522cs_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
530static inline struct ccs __iomem *ccs_base(ray_dev_t *dev) 529static 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
74static void spectrum_cs_config(struct pcmcia_device *link); 74static int spectrum_cs_config(struct pcmcia_device *link);
75static void spectrum_cs_release(struct pcmcia_device *link); 75static 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. */
585static int 585static int
586spectrum_cs_attach(struct pcmcia_device *link) 586spectrum_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
650static void 648static int
651spectrum_cs_config(struct pcmcia_device *link) 649spectrum_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 */
4582static int 4582static int
4583wavelan_attach(struct pcmcia_device *p_dev) 4583wavelan_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 */
106static void wl3501_config(struct pcmcia_device *link); 106static int wl3501_config(struct pcmcia_device *link);
107static void wl3501_release(struct pcmcia_device *link); 107static 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 */
1923static int wl3501_attach(struct pcmcia_device *p_dev) 1923static 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;
1966out_link: 1964out_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 */
1981static void wl3501_config(struct pcmcia_device *link) 1979static 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
2086cs_failed: 2085cs_failed:
2087 cs_error(link, last_fn, last_ret); 2086 cs_error(link, last_fn, last_ret);
2088failed: 2087failed:
2089 wl3501_release(link); 2088 wl3501_release(link);
2090out: 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,