diff options
author | Takashi Iwai <tiwai@alsa3.local> | 2008-12-28 10:47:30 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-01-12 09:21:54 -0500 |
commit | 3e7fb9f7ec00fd7cefd0d8e83df0cff86ce12515 (patch) | |
tree | dd04faa1ccf4d894bda0ca14eb667bc4be096623 /sound/isa/opti9xx | |
parent | d453379bc5d34d7f55b55931245de5ac1896fd8d (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/opti9xx')
-rw-r--r-- | sound/isa/opti9xx/opti92x-ad1848.c | 20 |
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) | |||
830 | return snd_card_register(card); | 830 | return snd_card_register(card); |
831 | } | 831 | } |
832 | 832 | ||
833 | static struct snd_card *snd_opti9xx_card_new(void) | 833 | static int snd_opti9xx_card_new(struct snd_card **cardp) |
834 | { | 834 | { |
835 | struct snd_card *card; | 835 | struct snd_card *card; |
836 | int err; | ||
837 | 836 | ||
838 | err = snd_card_create(index, id, THIS_MODULE, | 837 | err = snd_card_create(index, id, THIS_MODULE, |
839 | sizeof(struct snd_opti9xx), &card); | 838 | sizeof(struct snd_opti9xx), &card); |
840 | if (err < 0) | 839 | if (err < 0) |
841 | return NULL; | 840 | return err; |
842 | card->private_free = snd_card_opti9xx_free; | 841 | card->private_free = snd_card_opti9xx_free; |
843 | return card; | 842 | *cardp = card; |
843 | return 0; | ||
844 | } | 844 | } |
845 | 845 | ||
846 | static int __devinit snd_opti9xx_isa_match(struct device *devptr, | 846 | static int __devinit snd_opti9xx_isa_match(struct device *devptr, |
@@ -905,9 +905,9 @@ static int __devinit snd_opti9xx_isa_probe(struct device *devptr, | |||
905 | } | 905 | } |
906 | #endif | 906 | #endif |
907 | 907 | ||
908 | card = snd_opti9xx_card_new(); | 908 | error = snd_opti9xx_card_new(&card); |
909 | if (! card) | 909 | if (error < 0) |
910 | return -ENOMEM; | 910 | return error; |
911 | 911 | ||
912 | if ((error = snd_card_opti9xx_detect(card, card->private_data)) < 0) { | 912 | if ((error = snd_card_opti9xx_detect(card, card->private_data)) < 0) { |
913 | snd_card_free(card); | 913 | snd_card_free(card); |
@@ -952,9 +952,9 @@ static int __devinit snd_opti9xx_pnp_probe(struct pnp_card_link *pcard, | |||
952 | return -EBUSY; | 952 | return -EBUSY; |
953 | if (! isapnp) | 953 | if (! isapnp) |
954 | return -ENODEV; | 954 | return -ENODEV; |
955 | card = snd_opti9xx_card_new(); | 955 | error = snd_opti9xx_card_new(&card); |
956 | if (! card) | 956 | if (error < 0) |
957 | return -ENOMEM; | 957 | return error; |
958 | chip = card->private_data; | 958 | chip = card->private_data; |
959 | 959 | ||
960 | hw = snd_card_opti9xx_pnp(chip, pcard, pid); | 960 | hw = snd_card_opti9xx_pnp(chip, pcard, pid); |