aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia
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/pcmcia
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/pcmcia')
-rw-r--r--drivers/net/pcmcia/3c574_cs.c16
-rw-r--r--drivers/net/pcmcia/3c589_cs.c17
-rw-r--r--drivers/net/pcmcia/axnet_cs.c16
-rw-r--r--drivers/net/pcmcia/com20020_cs.c15
-rw-r--r--drivers/net/pcmcia/fmvj18x_cs.c16
-rw-r--r--drivers/net/pcmcia/ibmtr_cs.c11
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c23
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c12
-rw-r--r--drivers/net/pcmcia/smc91c92_cs.c16
-rw-r--r--drivers/net/pcmcia/xirc2ps_cs.c17
10 files changed, 70 insertions, 89 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
228static void tc574_config(struct pcmcia_device *link); 228static int tc574_config(struct pcmcia_device *link);
229static void tc574_release(struct pcmcia_device *link); 229static void tc574_release(struct pcmcia_device *link);
230 230
231static void mdio_sync(kio_addr_t ioaddr, int bits); 231static 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
259static int tc574_attach(struct pcmcia_device *link) 259static 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
338static const char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"}; 336static const char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"};
339 337
340static void tc574_config(struct pcmcia_device *link) 338static 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
491cs_failed: 489cs_failed:
492 cs_error(link, last_fn, last_ret); 490 cs_error(link, last_fn, last_ret);
493failed: 491failed:
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
145static void tc589_config(struct pcmcia_device *link); 145static int tc589_config(struct pcmcia_device *link);
146static void tc589_release(struct pcmcia_device *link); 146static void tc589_release(struct pcmcia_device *link);
147 147
148static u16 read_eeprom(kio_addr_t ioaddr, int index); 148static 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
173static int tc589_attach(struct pcmcia_device *link) 173static 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) \
253do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 251do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
254 252
255static void tc589_config(struct pcmcia_device *link) 253static 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
364cs_failed: 362cs_failed:
365 cs_error(link, last_fn, last_ret); 363 cs_error(link, last_fn, last_ret);
366failed: 364failed:
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
89static void axnet_config(struct pcmcia_device *link); 89static int axnet_config(struct pcmcia_device *link);
90static void axnet_release(struct pcmcia_device *link); 90static void axnet_release(struct pcmcia_device *link);
91static int axnet_open(struct net_device *dev); 91static int axnet_open(struct net_device *dev);
92static int axnet_close(struct net_device *dev); 92static 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
145static int axnet_attach(struct pcmcia_device *link) 145static 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
291static void axnet_config(struct pcmcia_device *link) 289static 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
430cs_failed: 428cs_failed:
431 cs_error(link, last_fn, last_ret); 429 cs_error(link, last_fn, last_ret);
432failed: 430failed:
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
121static void com20020_config(struct pcmcia_device *link); 121static int com20020_config(struct pcmcia_device *link);
122static void com20020_release(struct pcmcia_device *link); 122static void com20020_release(struct pcmcia_device *link);
123 123
124static void com20020_detach(struct pcmcia_device *p_dev); 124static void com20020_detach(struct pcmcia_device *p_dev);
@@ -138,7 +138,7 @@ typedef struct com20020_dev_t {
138 138
139======================================================================*/ 139======================================================================*/
140 140
141static int com20020_attach(struct pcmcia_device *p_dev) 141static 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
186fail_alloc_dev: 184fail_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) \
251do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 249do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
252 250
253static void com20020_config(struct pcmcia_device *link) 251static 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
350cs_failed: 348cs_failed:
351 cs_error(link, last_fn, last_ret); 349 cs_error(link, last_fn, last_ret);
352failed: 350failed:
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 */
87static void fmvj18x_config(struct pcmcia_device *link); 87static int fmvj18x_config(struct pcmcia_device *link);
88static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id); 88static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id);
89static int fmvj18x_setup_mfc(struct pcmcia_device *link); 89static int fmvj18x_setup_mfc(struct pcmcia_device *link);
90static void fmvj18x_release(struct pcmcia_device *link); 90static 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
231static int fmvj18x_attach(struct pcmcia_device *link) 231static 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
342static void fmvj18x_config(struct pcmcia_device *link) 340static 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
557cs_failed: 555cs_failed:
558 /* All Card Services errors end up here */ 556 /* All Card Services errors end up here */
@@ -560,7 +558,7 @@ cs_failed:
560failed: 558failed:
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
108static void ibmtr_config(struct pcmcia_device *link); 108static int ibmtr_config(struct pcmcia_device *link);
109static void ibmtr_hw_setup(struct net_device *dev, u_int mmiobase); 109static void ibmtr_hw_setup(struct net_device *dev, u_int mmiobase);
110static void ibmtr_release(struct pcmcia_device *link); 110static void ibmtr_release(struct pcmcia_device *link);
111static void ibmtr_detach(struct pcmcia_device *p_dev); 111static 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) \
221do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 219do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
222 220
223static void ibmtr_config(struct pcmcia_device *link) 221static 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
328cs_failed: 326cs_failed:
329 cs_error(link, last_fn, last_ret); 327 cs_error(link, last_fn, last_ret);
330failed: 328failed:
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);
417Function Prototypes 417Function Prototypes
418---------------------------------------------------------------------------- */ 418---------------------------------------------------------------------------- */
419 419
420static void nmclan_config(struct pcmcia_device *link); 420static int nmclan_config(struct pcmcia_device *link);
421static void nmclan_release(struct pcmcia_device *link); 421static void nmclan_release(struct pcmcia_device *link);
422 422
423static void nmclan_reset(struct net_device *dev); 423static void nmclan_reset(struct net_device *dev);
@@ -443,7 +443,7 @@ nmclan_attach
443 Services. 443 Services.
444---------------------------------------------------------------------------- */ 444---------------------------------------------------------------------------- */
445 445
446static int nmclan_attach(struct pcmcia_device *link) 446static 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
658static void nmclan_config(struct pcmcia_device *link) 656static 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
745cs_failed: 743cs_failed:
746 cs_error(link, last_fn, last_ret); 744 cs_error(link, last_fn, last_ret);
747failed: 745failed:
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
105static void mii_phy_probe(struct net_device *dev); 105static void mii_phy_probe(struct net_device *dev);
106static void pcnet_config(struct pcmcia_device *link); 106static int pcnet_config(struct pcmcia_device *link);
107static void pcnet_release(struct pcmcia_device *link); 107static void pcnet_release(struct pcmcia_device *link);
108static int pcnet_open(struct net_device *dev); 108static int pcnet_open(struct net_device *dev);
109static int pcnet_close(struct net_device *dev); 109static 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
519static void pcnet_config(struct pcmcia_device *link) 517static 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
706cs_failed: 704cs_failed:
707 cs_error(link, last_fn, last_ret); 705 cs_error(link, last_fn, last_ret);
708failed: 706failed:
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
281static void smc91c92_detach(struct pcmcia_device *p_dev); 281static void smc91c92_detach(struct pcmcia_device *p_dev);
282static void smc91c92_config(struct pcmcia_device *link); 282static int smc91c92_config(struct pcmcia_device *link);
283static void smc91c92_release(struct pcmcia_device *link); 283static void smc91c92_release(struct pcmcia_device *link);
284 284
285static int smc_open(struct net_device *dev); 285static int smc_open(struct net_device *dev);
@@ -309,7 +309,7 @@ static struct ethtool_ops ethtool_ops;
309 309
310======================================================================*/ 310======================================================================*/
311 311
312static int smc91c92_attach(struct pcmcia_device *link) 312static 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) \
973if (ret != CS_SUCCESS) { cs_error(link, svc, ret); goto label; } 971if (ret != CS_SUCCESS) { cs_error(link, svc, ret); goto label; }
974 972
975static void smc91c92_config(struct pcmcia_device *link) 973static 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
1150config_undo: 1148config_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
292static int has_ce2_string(struct pcmcia_device * link); 292static int has_ce2_string(struct pcmcia_device * link);
293static void xirc2ps_config(struct pcmcia_device * link); 293static int xirc2ps_config(struct pcmcia_device * link);
294static void xirc2ps_release(struct pcmcia_device * link); 294static 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
555static int 555static int
556xirc2ps_attach(struct pcmcia_device *link) 556xirc2ps_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 */
734static void 732static int
735xirc2ps_config(struct pcmcia_device * link) 733xirc2ps_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,