aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/wavefront
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@alsa3.local>2008-12-28 10:47:30 -0500
committerTakashi Iwai <tiwai@suse.de>2009-01-12 09:21:54 -0500
commit3e7fb9f7ec00fd7cefd0d8e83df0cff86ce12515 (patch)
treedd04faa1ccf4d894bda0ca14eb667bc4be096623 /sound/isa/wavefront
parentd453379bc5d34d7f55b55931245de5ac1896fd8d (diff)
ALSA: Return proper error code at probe in sound/isa/*
Some drivers in sound/isa/* don't handle the error code properly from snd_card_create(). This patch fixes these places. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa/wavefront')
-rw-r--r--sound/isa/wavefront/wavefront.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c
index 82b8fb746908..95898b2b7b58 100644
--- a/sound/isa/wavefront/wavefront.c
+++ b/sound/isa/wavefront/wavefront.c
@@ -338,7 +338,7 @@ snd_wavefront_free(struct snd_card *card)
338 } 338 }
339} 339}
340 340
341static struct snd_card *snd_wavefront_card_new(int dev) 341static int snd_wavefront_card_new(int dev, struct snd_card **cardp)
342{ 342{
343 struct snd_card *card; 343 struct snd_card *card;
344 snd_wavefront_card_t *acard; 344 snd_wavefront_card_t *acard;
@@ -347,7 +347,7 @@ static struct snd_card *snd_wavefront_card_new(int dev)
347 err = snd_card_create(index[dev], id[dev], THIS_MODULE, 347 err = snd_card_create(index[dev], id[dev], THIS_MODULE,
348 sizeof(snd_wavefront_card_t), &card); 348 sizeof(snd_wavefront_card_t), &card);
349 if (err < 0) 349 if (err < 0)
350 return NULL; 350 return err;
351 351
352 acard = card->private_data; 352 acard = card->private_data;
353 acard->wavefront.irq = -1; 353 acard->wavefront.irq = -1;
@@ -358,7 +358,8 @@ static struct snd_card *snd_wavefront_card_new(int dev)
358 acard->wavefront.card = card; 358 acard->wavefront.card = card;
359 card->private_free = snd_wavefront_free; 359 card->private_free = snd_wavefront_free;
360 360
361 return card; 361 *cardp = card;
362 return 0;
362} 363}
363 364
364static int __devinit 365static int __devinit
@@ -568,9 +569,9 @@ static int __devinit snd_wavefront_isa_probe(struct device *pdev,
568 struct snd_card *card; 569 struct snd_card *card;
569 int err; 570 int err;
570 571
571 card = snd_wavefront_card_new(dev); 572 err = snd_wavefront_card_new(dev, &card);
572 if (! card) 573 if (err < 0)
573 return -ENOMEM; 574 return err;
574 snd_card_set_dev(card, pdev); 575 snd_card_set_dev(card, pdev);
575 if ((err = snd_wavefront_probe(card, dev)) < 0) { 576 if ((err = snd_wavefront_probe(card, dev)) < 0) {
576 snd_card_free(card); 577 snd_card_free(card);
@@ -617,9 +618,9 @@ static int __devinit snd_wavefront_pnp_detect(struct pnp_card_link *pcard,
617 if (dev >= SNDRV_CARDS) 618 if (dev >= SNDRV_CARDS)
618 return -ENODEV; 619 return -ENODEV;
619 620
620 card = snd_wavefront_card_new(dev); 621 res = snd_wavefront_card_new(dev, &card);
621 if (! card) 622 if (res < 0)
622 return -ENOMEM; 623 return res;
623 624
624 if (snd_wavefront_pnp (dev, card->private_data, pcard, pid) < 0) { 625 if (snd_wavefront_pnp (dev, card->private_data, pcard, pid) < 0) {
625 if (cs4232_pcm_port[dev] == SNDRV_AUTO_PORT) { 626 if (cs4232_pcm_port[dev] == SNDRV_AUTO_PORT) {