From 15b99ac1729503db9e6dc642a50b9b6cb3bf51f9 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Fri, 31 Mar 2006 17:26:06 +0200 Subject: [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 --- drivers/net/wireless/ray_cs.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'drivers/net/wireless/ray_cs.c') diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 415ae8be1e2..8cfe9332a3c 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); #define DEBUG(n, args...) #endif /** Prototypes based on PCMCIA skeleton driver *******************************/ -static void ray_config(struct pcmcia_device *link); +static int ray_config(struct pcmcia_device *link); static void ray_release(struct pcmcia_device *link); static void ray_detach(struct pcmcia_device *p_dev); @@ -303,7 +303,7 @@ static char rcsid[] = "Raylink/WebGear wireless LAN - Corey state |= DEV_PRESENT | DEV_CONFIG_PENDING; this_device = p_dev; - ray_config(p_dev); - - return 0; + return ray_config(p_dev); fail_alloc_dev: return -ENOMEM; @@ -412,7 +410,7 @@ static void ray_detach(struct pcmcia_device *link) #define CS_CHECK(fn, ret) \ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) #define MAX_TUPLE_SIZE 128 -static void ray_config(struct pcmcia_device *link) +static int ray_config(struct pcmcia_device *link) { tuple_t tuple; cisparse_t parse; @@ -499,7 +497,7 @@ static void ray_config(struct pcmcia_device *link) DEBUG(3,"ray_config amem=%p\n",local->amem); if (ray_init(dev) < 0) { ray_release(link); - return; + return -ENODEV; } SET_NETDEV_DEV(dev, &handle_to_dev(link)); @@ -507,7 +505,7 @@ static void ray_config(struct pcmcia_device *link) if (i != 0) { printk("ray_config register_netdev() failed\n"); ray_release(link); - return; + return i; } strcpy(local->node.dev_name, dev->name); @@ -519,12 +517,13 @@ static void ray_config(struct pcmcia_device *link) for (i = 0; i < 6; i++) printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n")); - return; + return 0; cs_failed: cs_error(link, last_fn, last_ret); ray_release(link); + return -ENODEV; } /* ray_config */ static inline struct ccs __iomem *ccs_base(ray_dev_t *dev) @@ -2846,7 +2845,7 @@ static struct pcmcia_driver ray_driver = { .drv = { .name = "ray_cs", }, - .probe = ray_attach, + .probe = ray_probe, .remove = ray_detach, .id_table = ray_ids, .suspend = ray_suspend, -- cgit v1.2.3-70-g09d2