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/wireless/netwave_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/wireless/netwave_cs.c')
-rw-r--r-- | drivers/net/wireless/netwave_cs.c | 15 |
1 files changed, 7 insertions, 8 deletions
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 */ |
193 | static void netwave_release(struct pcmcia_device *link); /* Card removal */ | 193 | static void netwave_release(struct pcmcia_device *link); /* Card removal */ |
194 | static void netwave_pcmcia_config(struct pcmcia_device *arg); /* Runs after card | 194 | static int netwave_pcmcia_config(struct pcmcia_device *arg); /* Runs after card |
195 | insertion */ | 195 | insertion */ |
196 | static void netwave_detach(struct pcmcia_device *p_dev); /* Destroy instance */ | 196 | static 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 | */ |
379 | static int netwave_attach(struct pcmcia_device *link) | 379 | static 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) \ |
738 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 736 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
739 | 737 | ||
740 | static void netwave_pcmcia_config(struct pcmcia_device *link) { | 738 | static 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 | ||
850 | cs_failed: | 848 | cs_failed: |
851 | cs_error(link, last_fn, last_ret); | 849 | cs_error(link, last_fn, last_ret); |
852 | failed: | 850 | failed: |
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, |