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 /sound/pcmcia/vx/vxpocket.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 'sound/pcmcia/vx/vxpocket.c')
-rw-r--r-- | sound/pcmcia/vx/vxpocket.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c index f6eed4259d17..4004b35e8af5 100644 --- a/sound/pcmcia/vx/vxpocket.c +++ b/sound/pcmcia/vx/vxpocket.c | |||
@@ -208,7 +208,7 @@ static int snd_vxpocket_assign_resources(struct vx_core *chip, int port, int irq | |||
208 | #define CS_CHECK(fn, ret) \ | 208 | #define CS_CHECK(fn, ret) \ |
209 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 209 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
210 | 210 | ||
211 | static void vxpocket_config(struct pcmcia_device *link) | 211 | static int vxpocket_config(struct pcmcia_device *link) |
212 | { | 212 | { |
213 | struct vx_core *chip = link->priv; | 213 | struct vx_core *chip = link->priv; |
214 | struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip; | 214 | struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip; |
@@ -221,7 +221,7 @@ static void vxpocket_config(struct pcmcia_device *link) | |||
221 | parse = kmalloc(sizeof(*parse), GFP_KERNEL); | 221 | parse = kmalloc(sizeof(*parse), GFP_KERNEL); |
222 | if (! parse) { | 222 | if (! parse) { |
223 | snd_printk(KERN_ERR "vx: cannot allocate\n"); | 223 | snd_printk(KERN_ERR "vx: cannot allocate\n"); |
224 | return; | 224 | return -ENOMEM; |
225 | } | 225 | } |
226 | tuple.Attributes = 0; | 226 | tuple.Attributes = 0; |
227 | tuple.TupleData = (cisdata_t *)buf; | 227 | tuple.TupleData = (cisdata_t *)buf; |
@@ -265,13 +265,14 @@ static void vxpocket_config(struct pcmcia_device *link) | |||
265 | link->dev_node = &vxp->node; | 265 | link->dev_node = &vxp->node; |
266 | link->state &= ~DEV_CONFIG_PENDING; | 266 | link->state &= ~DEV_CONFIG_PENDING; |
267 | kfree(parse); | 267 | kfree(parse); |
268 | return; | 268 | return 9; |
269 | 269 | ||
270 | cs_failed: | 270 | cs_failed: |
271 | cs_error(link, last_fn, last_ret); | 271 | cs_error(link, last_fn, last_ret); |
272 | failed: | 272 | failed: |
273 | pcmcia_disable_device(link); | 273 | pcmcia_disable_device(link); |
274 | kfree(parse); | 274 | kfree(parse); |
275 | return -ENODEV; | ||
275 | } | 276 | } |
276 | 277 | ||
277 | #ifdef CONFIG_PM | 278 | #ifdef CONFIG_PM |
@@ -311,7 +312,7 @@ static int vxp_resume(struct pcmcia_device *link) | |||
311 | 312 | ||
312 | /* | 313 | /* |
313 | */ | 314 | */ |
314 | static int vxpocket_attach(struct pcmcia_device *p_dev) | 315 | static int vxpocket_probe(struct pcmcia_device *p_dev) |
315 | { | 316 | { |
316 | struct snd_card *card; | 317 | struct snd_card *card; |
317 | struct snd_vxpocket *vxp; | 318 | struct snd_vxpocket *vxp; |
@@ -349,9 +350,7 @@ static int vxpocket_attach(struct pcmcia_device *p_dev) | |||
349 | vxp->p_dev = p_dev; | 350 | vxp->p_dev = p_dev; |
350 | vxp->p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 351 | vxp->p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
351 | 352 | ||
352 | vxpocket_config(p_dev); | 353 | return vxpocket_config(p_dev); |
353 | |||
354 | return 0; | ||
355 | } | 354 | } |
356 | 355 | ||
357 | static void vxpocket_detach(struct pcmcia_device *link) | 356 | static void vxpocket_detach(struct pcmcia_device *link) |
@@ -387,7 +386,7 @@ static struct pcmcia_driver vxp_cs_driver = { | |||
387 | .drv = { | 386 | .drv = { |
388 | .name = "snd-vxpocket", | 387 | .name = "snd-vxpocket", |
389 | }, | 388 | }, |
390 | .probe = vxpocket_attach, | 389 | .probe = vxpocket_probe, |
391 | .remove = vxpocket_detach, | 390 | .remove = vxpocket_detach, |
392 | .id_table = vxp_ids, | 391 | .id_table = vxp_ids, |
393 | #ifdef CONFIG_PM | 392 | #ifdef CONFIG_PM |