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/pcmcia/nmclan_cs.c | |
parent | fba395eee7d3f342ca739c20f5b3ee635d0420a0 (diff) |
[PATCH] pcmcia: add return value to _config() functions
Most of the driver initialization isn't done in the .probe function, but in
the internal _config() functions. Make them return a value, so that .probe
can properly report whether the probing of the device succeeded or not.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/pcmcia/nmclan_cs.c')
-rw-r--r-- | drivers/net/pcmcia/nmclan_cs.c | 23 |
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); | |||
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, |