aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/gus
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/gus
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/gus')
-rw-r--r--sound/isa/gus/interwave.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c
index e040c7638911..50e429a120da 100644
--- a/sound/isa/gus/interwave.c
+++ b/sound/isa/gus/interwave.c
@@ -626,7 +626,7 @@ static void snd_interwave_free(struct snd_card *card)
626 free_irq(iwcard->irq, (void *)iwcard); 626 free_irq(iwcard->irq, (void *)iwcard);
627} 627}
628 628
629static struct snd_card *snd_interwave_card_new(int dev) 629static int snd_interwave_card_new(int dev, struct snd_card **cardp)
630{ 630{
631 struct snd_card *card; 631 struct snd_card *card;
632 struct snd_interwave *iwcard; 632 struct snd_interwave *iwcard;
@@ -635,12 +635,13 @@ static struct snd_card *snd_interwave_card_new(int dev)
635 err = snd_card_create(index[dev], id[dev], THIS_MODULE, 635 err = snd_card_create(index[dev], id[dev], THIS_MODULE,
636 sizeof(struct snd_interwave), &card); 636 sizeof(struct snd_interwave), &card);
637 if (err < 0) 637 if (err < 0)
638 return NULL; 638 return err;
639 iwcard = card->private_data; 639 iwcard = card->private_data;
640 iwcard->card = card; 640 iwcard->card = card;
641 iwcard->irq = -1; 641 iwcard->irq = -1;
642 card->private_free = snd_interwave_free; 642 card->private_free = snd_interwave_free;
643 return card; 643 *cardp = card;
644 return 0;
644} 645}
645 646
646static int __devinit snd_interwave_probe(struct snd_card *card, int dev) 647static int __devinit snd_interwave_probe(struct snd_card *card, int dev)
@@ -779,9 +780,9 @@ static int __devinit snd_interwave_isa_probe1(int dev, struct device *devptr)
779 struct snd_card *card; 780 struct snd_card *card;
780 int err; 781 int err;
781 782
782 card = snd_interwave_card_new(dev); 783 err = snd_interwave_card_new(dev, &card);
783 if (! card) 784 if (err < 0)
784 return -ENOMEM; 785 return err;
785 786
786 snd_card_set_dev(card, devptr); 787 snd_card_set_dev(card, devptr);
787 if ((err = snd_interwave_probe(card, dev)) < 0) { 788 if ((err = snd_interwave_probe(card, dev)) < 0) {
@@ -877,9 +878,9 @@ static int __devinit snd_interwave_pnp_detect(struct pnp_card_link *pcard,
877 if (dev >= SNDRV_CARDS) 878 if (dev >= SNDRV_CARDS)
878 return -ENODEV; 879 return -ENODEV;
879 880
880 card = snd_interwave_card_new(dev); 881 res = snd_interwave_card_new(dev, &card);
881 if (! card) 882 if (res < 0)
882 return -ENOMEM; 883 return res;
883 884
884 if ((res = snd_interwave_pnp(dev, card->private_data, pcard, pid)) < 0) { 885 if ((res = snd_interwave_pnp(dev, card->private_data, pcard, pid)) < 0) {
885 snd_card_free(card); 886 snd_card_free(card);