diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 19:26:06 +0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 19:26:06 +0400 |
commit | 15b99ac1729503db9e6dc642a50b9b6cb3bf51f9 (patch) | |
tree | cfb8897487beba502aac2b28bc35066a87e34299 /drivers/parport | |
parent | fba395eee7d3f342ca739c20f5b3ee635d0420a0 (diff) | |
download | linux-15b99ac1729503db9e6dc642a50b9b6cb3bf51f9.tar.xz |
[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/parport')
-rw-r--r-- | drivers/parport/parport_cs.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c index 6dcaf44c120a..e4be826c48ba 100644 --- a/drivers/parport/parport_cs.c +++ b/drivers/parport/parport_cs.c @@ -88,7 +88,7 @@ typedef struct parport_info_t { } parport_info_t; static void parport_detach(struct pcmcia_device *p_dev); -static void parport_config(struct pcmcia_device *link); +static int parport_config(struct pcmcia_device *link); static void parport_cs_release(struct pcmcia_device *); /*====================================================================== @@ -99,7 +99,7 @@ static void parport_cs_release(struct pcmcia_device *); ======================================================================*/ -static int parport_attach(struct pcmcia_device *link) +static int parport_probe(struct pcmcia_device *link) { parport_info_t *info; @@ -120,9 +120,7 @@ static int parport_attach(struct pcmcia_device *link) link->conf.IntType = INT_MEMORY_AND_IO; link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; - parport_config(link); - - return 0; + return parport_config(link); } /* parport_attach */ /*====================================================================== @@ -155,7 +153,7 @@ static void parport_detach(struct pcmcia_device *link) #define CS_CHECK(fn, ret) \ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) -void parport_config(struct pcmcia_device *link) +static int parport_config(struct pcmcia_device *link) { parport_info_t *info = link->priv; tuple_t tuple; @@ -236,14 +234,14 @@ void parport_config(struct pcmcia_device *link) link->dev_node = &info->node; link->state &= ~DEV_CONFIG_PENDING; - return; - + return 0; + cs_failed: cs_error(link, last_fn, last_ret); failed: parport_cs_release(link); link->state &= ~DEV_CONFIG_PENDING; - + return -ENODEV; } /* parport_config */ /*====================================================================== @@ -282,7 +280,7 @@ static struct pcmcia_driver parport_cs_driver = { .drv = { .name = "parport_cs", }, - .probe = parport_attach, + .probe = parport_probe, .remove = parport_detach, .id_table = parport_ids, }; |