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/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 bad68187f215..a27df6101dc6 100644 --- a/drivers/telephony/ixj_pcmcia.c +++ b/drivers/telephony/ixj_pcmcia.c | |||
@@ -35,10 +35,10 @@ typedef struct ixj_info_t { | |||
35 | } ixj_info_t; | 35 | } ixj_info_t; |
36 | 36 | ||
37 | static void ixj_detach(struct pcmcia_device *p_dev); | 37 | static void ixj_detach(struct pcmcia_device *p_dev); |
38 | static void ixj_config(struct pcmcia_device * link); | 38 | static int ixj_config(struct pcmcia_device * link); |
39 | static void ixj_cs_release(struct pcmcia_device * link); | 39 | static void ixj_cs_release(struct pcmcia_device * link); |
40 | 40 | ||
41 | static int ixj_attach(struct pcmcia_device *p_dev) | 41 | static int ixj_probe(struct pcmcia_device *p_dev) |
42 | { | 42 | { |
43 | DEBUG(0, "ixj_attach()\n"); | 43 | DEBUG(0, "ixj_attach()\n"); |
44 | /* Create new ixj device */ | 44 | /* Create new ixj device */ |
@@ -53,9 +53,7 @@ static int ixj_attach(struct pcmcia_device *p_dev) | |||
53 | memset(p_dev->priv, 0, sizeof(struct ixj_info_t)); | 53 | memset(p_dev->priv, 0, sizeof(struct ixj_info_t)); |
54 | 54 | ||
55 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 55 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
56 | ixj_config(p_dev); | 56 | return ixj_config(p_dev); |
57 | |||
58 | return 0; | ||
59 | } | 57 | } |
60 | 58 | ||
61 | static void ixj_detach(struct pcmcia_device *link) | 59 | static void ixj_detach(struct pcmcia_device *link) |
@@ -133,7 +131,7 @@ static void ixj_get_serial(struct pcmcia_device * link, IXJ * j) | |||
133 | return; | 131 | return; |
134 | } | 132 | } |
135 | 133 | ||
136 | static void ixj_config(struct pcmcia_device * link) | 134 | static int ixj_config(struct pcmcia_device * link) |
137 | { | 135 | { |
138 | IXJ *j; | 136 | IXJ *j; |
139 | ixj_info_t *info; | 137 | ixj_info_t *info; |
@@ -198,10 +196,11 @@ static void ixj_config(struct pcmcia_device * link) | |||
198 | link->dev_node = &info->node; | 196 | link->dev_node = &info->node; |
199 | ixj_get_serial(link, j); | 197 | ixj_get_serial(link, j); |
200 | link->state &= ~DEV_CONFIG_PENDING; | 198 | link->state &= ~DEV_CONFIG_PENDING; |
201 | return; | 199 | return 0; |
202 | cs_failed: | 200 | cs_failed: |
203 | cs_error(link, last_fn, last_ret); | 201 | cs_error(link, last_fn, last_ret); |
204 | ixj_cs_release(link); | 202 | ixj_cs_release(link); |
203 | return -ENODEV; | ||
205 | } | 204 | } |
206 | 205 | ||
207 | static void ixj_cs_release(struct pcmcia_device *link) | 206 | static void ixj_cs_release(struct pcmcia_device *link) |
@@ -223,7 +222,7 @@ static struct pcmcia_driver ixj_driver = { | |||
223 | .drv = { | 222 | .drv = { |
224 | .name = "ixj_cs", | 223 | .name = "ixj_cs", |
225 | }, | 224 | }, |
226 | .probe = ixj_attach, | 225 | .probe = ixj_probe, |
227 | .remove = ixj_detach, | 226 | .remove = ixj_detach, |
228 | .id_table = ixj_ids, | 227 | .id_table = ixj_ids, |
229 | }; | 228 | }; |