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/ray_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/ray_cs.c')
-rw-r--r-- | drivers/net/wireless/ray_cs.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 415ae8be1e22..8cfe9332a3c1 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c | |||
@@ -90,7 +90,7 @@ module_param(pc_debug, int, 0); | |||
90 | #define DEBUG(n, args...) | 90 | #define DEBUG(n, args...) |
91 | #endif | 91 | #endif |
92 | /** Prototypes based on PCMCIA skeleton driver *******************************/ | 92 | /** Prototypes based on PCMCIA skeleton driver *******************************/ |
93 | static void ray_config(struct pcmcia_device *link); | 93 | static int ray_config(struct pcmcia_device *link); |
94 | static void ray_release(struct pcmcia_device *link); | 94 | static void ray_release(struct pcmcia_device *link); |
95 | static void ray_detach(struct pcmcia_device *p_dev); | 95 | static void ray_detach(struct pcmcia_device *p_dev); |
96 | 96 | ||
@@ -303,7 +303,7 @@ static char rcsid[] = "Raylink/WebGear wireless LAN - Corey <Thomas corey@world. | |||
303 | configure the card at this point -- we wait until we receive a | 303 | configure the card at this point -- we wait until we receive a |
304 | card insertion event. | 304 | card insertion event. |
305 | =============================================================================*/ | 305 | =============================================================================*/ |
306 | static int ray_attach(struct pcmcia_device *p_dev) | 306 | static int ray_probe(struct pcmcia_device *p_dev) |
307 | { | 307 | { |
308 | ray_dev_t *local; | 308 | ray_dev_t *local; |
309 | struct net_device *dev; | 309 | struct net_device *dev; |
@@ -368,9 +368,7 @@ static int ray_attach(struct pcmcia_device *p_dev) | |||
368 | 368 | ||
369 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 369 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
370 | this_device = p_dev; | 370 | this_device = p_dev; |
371 | ray_config(p_dev); | 371 | return ray_config(p_dev); |
372 | |||
373 | return 0; | ||
374 | 372 | ||
375 | fail_alloc_dev: | 373 | fail_alloc_dev: |
376 | return -ENOMEM; | 374 | return -ENOMEM; |
@@ -412,7 +410,7 @@ static void ray_detach(struct pcmcia_device *link) | |||
412 | #define CS_CHECK(fn, ret) \ | 410 | #define CS_CHECK(fn, ret) \ |
413 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 411 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
414 | #define MAX_TUPLE_SIZE 128 | 412 | #define MAX_TUPLE_SIZE 128 |
415 | static void ray_config(struct pcmcia_device *link) | 413 | static int ray_config(struct pcmcia_device *link) |
416 | { | 414 | { |
417 | tuple_t tuple; | 415 | tuple_t tuple; |
418 | cisparse_t parse; | 416 | cisparse_t parse; |
@@ -499,7 +497,7 @@ static void ray_config(struct pcmcia_device *link) | |||
499 | DEBUG(3,"ray_config amem=%p\n",local->amem); | 497 | DEBUG(3,"ray_config amem=%p\n",local->amem); |
500 | if (ray_init(dev) < 0) { | 498 | if (ray_init(dev) < 0) { |
501 | ray_release(link); | 499 | ray_release(link); |
502 | return; | 500 | return -ENODEV; |
503 | } | 501 | } |
504 | 502 | ||
505 | SET_NETDEV_DEV(dev, &handle_to_dev(link)); | 503 | SET_NETDEV_DEV(dev, &handle_to_dev(link)); |
@@ -507,7 +505,7 @@ static void ray_config(struct pcmcia_device *link) | |||
507 | if (i != 0) { | 505 | if (i != 0) { |
508 | printk("ray_config register_netdev() failed\n"); | 506 | printk("ray_config register_netdev() failed\n"); |
509 | ray_release(link); | 507 | ray_release(link); |
510 | return; | 508 | return i; |
511 | } | 509 | } |
512 | 510 | ||
513 | strcpy(local->node.dev_name, dev->name); | 511 | strcpy(local->node.dev_name, dev->name); |
@@ -519,12 +517,13 @@ static void ray_config(struct pcmcia_device *link) | |||
519 | for (i = 0; i < 6; i++) | 517 | for (i = 0; i < 6; i++) |
520 | printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); | 518 | printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); |
521 | 519 | ||
522 | return; | 520 | return 0; |
523 | 521 | ||
524 | cs_failed: | 522 | cs_failed: |
525 | cs_error(link, last_fn, last_ret); | 523 | cs_error(link, last_fn, last_ret); |
526 | 524 | ||
527 | ray_release(link); | 525 | ray_release(link); |
526 | return -ENODEV; | ||
528 | } /* ray_config */ | 527 | } /* ray_config */ |
529 | 528 | ||
530 | static inline struct ccs __iomem *ccs_base(ray_dev_t *dev) | 529 | static inline struct ccs __iomem *ccs_base(ray_dev_t *dev) |
@@ -2846,7 +2845,7 @@ static struct pcmcia_driver ray_driver = { | |||
2846 | .drv = { | 2845 | .drv = { |
2847 | .name = "ray_cs", | 2846 | .name = "ray_cs", |
2848 | }, | 2847 | }, |
2849 | .probe = ray_attach, | 2848 | .probe = ray_probe, |
2850 | .remove = ray_detach, | 2849 | .remove = ray_detach, |
2851 | .id_table = ray_ids, | 2850 | .id_table = ray_ids, |
2852 | .suspend = ray_suspend, | 2851 | .suspend = ray_suspend, |