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/xirc2ps_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/xirc2ps_cs.c')
-rw-r--r-- | drivers/net/pcmcia/xirc2ps_cs.c | 17 |
1 files changed, 8 insertions, 9 deletions
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, |