summary refs log tree commit diff
path: root/sound/isa/opti9xx
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@alsa3.local>2008-12-28 16:47:30 +0100
committerTakashi Iwai <tiwai@suse.de>2009-01-12 15:21:54 +0100
commit3e7fb9f7ec00fd7cefd0d8e83df0cff86ce12515 (patch)
treedd04faa1ccf4d894bda0ca14eb667bc4be096623 /sound/isa/opti9xx
parentd453379bc5d34d7f55b55931245de5ac1896fd8d (diff)
downloadlinux-3e7fb9f7ec00fd7cefd0d8e83df0cff86ce12515.tar.gz
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/opti9xx')
-rw-r--r--sound/isa/opti9xx/opti92x-ad1848.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c
index 5750f38bb797..87a4feb50109 100644
--- a/sound/isa/opti9xx/opti92x-ad1848.c
+++ b/sound/isa/opti9xx/opti92x-ad1848.c
@@ -830,17 +830,17 @@ static int __devinit snd_opti9xx_probe(struct snd_card *card)
 	return snd_card_register(card);
 }
 
-static struct snd_card *snd_opti9xx_card_new(void)
+static int snd_opti9xx_card_new(struct snd_card **cardp)
 {
 	struct snd_card *card;
-	int err;
 
 	err = snd_card_create(index, id, THIS_MODULE,
 			      sizeof(struct snd_opti9xx), &card);
 	if (err < 0)
-		return NULL;
+		return err;
 	card->private_free = snd_card_opti9xx_free;
-	return card;
+	*cardp = card;
+	return 0;
 }
 
 static int __devinit snd_opti9xx_isa_match(struct device *devptr,
@@ -905,9 +905,9 @@ static int __devinit snd_opti9xx_isa_probe(struct device *devptr,
 	}
 #endif
 
-	card = snd_opti9xx_card_new();
-	if (! card)
-		return -ENOMEM;
+	error = snd_opti9xx_card_new(&card);
+	if (error < 0)
+		return error;
 
 	if ((error = snd_card_opti9xx_detect(card, card->private_data)) < 0) {
 		snd_card_free(card);
@@ -952,9 +952,9 @@ static int __devinit snd_opti9xx_pnp_probe(struct pnp_card_link *pcard,
 		return -EBUSY;
 	if (! isapnp)
 		return -ENODEV;
-	card = snd_opti9xx_card_new();
-	if (! card)
-		return -ENOMEM;
+	error = snd_opti9xx_card_new(&card);
+	if (error < 0)
+		return error;
 	chip = card->private_data;
 
 	hw = snd_card_opti9xx_pnp(chip, pcard, pid);