diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 17:26:06 +0200 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 17:26:06 +0200 |
commit | 15b99ac1729503db9e6dc642a50b9b6cb3bf51f9 (patch) | |
tree | cfb8897487beba502aac2b28bc35066a87e34299 /drivers/telephony | |
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/telephony')
-rw-r--r-- | drivers/telephony/ixj_pcmcia.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/telephony/ixj_pcmcia.c b/drivers/telephony/ixj_pcmcia.c index bad68187f21..a27df6101dc 100644 --- a/drivers/telephony/ixj_pcmcia.c +++ b/drivers/telephony/ixj_pcmcia.c @@ -35,10 +35,10 @@ typedef struct ixj_info_t { } ixj_info_t; static void ixj_detach(struct pcmcia_device *p_dev); -static void ixj_config(struct pcmcia_device * link); +static int ixj_config(struct pcmcia_device * link); static void ixj_cs_release(struct pcmcia_device * link); -static int ixj_attach(struct pcmcia_device *p_dev) +static int ixj_probe(struct pcmcia_device *p_dev) { DEBUG(0, "ixj_attach()\n"); /* Create new ixj device */ @@ -53,9 +53,7 @@ static int ixj_attach(struct pcmcia_device *p_dev) memset(p_dev->priv, 0, sizeof(struct ixj_info_t)); p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; - ixj_config(p_dev); - - return 0; + return ixj_config(p_dev); } static void ixj_detach(struct pcmcia_device *link) @@ -133,7 +131,7 @@ static void ixj_get_serial(struct pcmcia_device * link, IXJ * j) return; } -static void ixj_config(struct pcmcia_device * link) +static int ixj_config(struct pcmcia_device * link) { IXJ *j; ixj_info_t *info; @@ -198,10 +196,11 @@ static void ixj_config(struct pcmcia_device * link) link->dev_node = &info->node; ixj_get_serial(link, j); link->state &= ~DEV_CONFIG_PENDING; - return; + return 0; cs_failed: cs_error(link, last_fn, last_ret); ixj_cs_release(link); + return -ENODEV; } static void ixj_cs_release(struct pcmcia_device *link) @@ -223,7 +222,7 @@ static struct pcmcia_driver ixj_driver = { .drv = { .name = "ixj_cs", }, - .probe = ixj_attach, + .probe = ixj_probe, .remove = ixj_detach, .id_table = ixj_ids, }; |