aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/nmclan_cs.c
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/nmclan_cs.c
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/nmclan_cs.c')
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c23
1 files changed, 10 insertions, 13 deletions
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,