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/es18xx.c | |
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/es18xx.c')
-rw-r--r-- | sound/isa/es18xx.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c index c24c6322fcc9..8cfbff73a835 100644 --- a/sound/isa/es18xx.c +++ b/sound/isa/es18xx.c | |||
@@ -2125,13 +2125,10 @@ static int __devinit snd_audiodrive_pnpc(int dev, struct snd_audiodrive *acard, | |||
2125 | #define is_isapnp_selected(dev) 0 | 2125 | #define is_isapnp_selected(dev) 0 |
2126 | #endif | 2126 | #endif |
2127 | 2127 | ||
2128 | static struct snd_card *snd_es18xx_card_new(int dev) | 2128 | static int snd_es18xx_card_new(int dev, struct snd_card **cardp) |
2129 | { | 2129 | { |
2130 | struct snd_card *card; | 2130 | return snd_card_create(index[dev], id[dev], THIS_MODULE, |
2131 | if (snd_card_create(index[dev], id[dev], THIS_MODULE, | 2131 | sizeof(struct snd_audiodrive), cardp); |
2132 | sizeof(struct snd_audiodrive), &card) < 0) | ||
2133 | return NULL; | ||
2134 | return card; | ||
2135 | } | 2132 | } |
2136 | 2133 | ||
2137 | static int __devinit snd_audiodrive_probe(struct snd_card *card, int dev) | 2134 | static int __devinit snd_audiodrive_probe(struct snd_card *card, int dev) |
@@ -2200,9 +2197,9 @@ static int __devinit snd_es18xx_isa_probe1(int dev, struct device *devptr) | |||
2200 | struct snd_card *card; | 2197 | struct snd_card *card; |
2201 | int err; | 2198 | int err; |
2202 | 2199 | ||
2203 | card = snd_es18xx_card_new(dev); | 2200 | err = snd_es18xx_card_new(dev, &card); |
2204 | if (! card) | 2201 | if (err < 0) |
2205 | return -ENOMEM; | 2202 | return err; |
2206 | snd_card_set_dev(card, devptr); | 2203 | snd_card_set_dev(card, devptr); |
2207 | if ((err = snd_audiodrive_probe(card, dev)) < 0) { | 2204 | if ((err = snd_audiodrive_probe(card, dev)) < 0) { |
2208 | snd_card_free(card); | 2205 | snd_card_free(card); |
@@ -2306,9 +2303,9 @@ static int __devinit snd_audiodrive_pnp_detect(struct pnp_dev *pdev, | |||
2306 | if (dev >= SNDRV_CARDS) | 2303 | if (dev >= SNDRV_CARDS) |
2307 | return -ENODEV; | 2304 | return -ENODEV; |
2308 | 2305 | ||
2309 | card = snd_es18xx_card_new(dev); | 2306 | err = snd_es18xx_card_new(dev, &card); |
2310 | if (! card) | 2307 | if (err < 0) |
2311 | return -ENOMEM; | 2308 | return err; |
2312 | if ((err = snd_audiodrive_pnp(dev, card->private_data, pdev)) < 0) { | 2309 | if ((err = snd_audiodrive_pnp(dev, card->private_data, pdev)) < 0) { |
2313 | snd_card_free(card); | 2310 | snd_card_free(card); |
2314 | return err; | 2311 | return err; |
@@ -2365,9 +2362,9 @@ static int __devinit snd_audiodrive_pnpc_detect(struct pnp_card_link *pcard, | |||
2365 | if (dev >= SNDRV_CARDS) | 2362 | if (dev >= SNDRV_CARDS) |
2366 | return -ENODEV; | 2363 | return -ENODEV; |
2367 | 2364 | ||
2368 | card = snd_es18xx_card_new(dev); | 2365 | res = snd_es18xx_card_new(dev, &card); |
2369 | if (! card) | 2366 | if (res < 0) |
2370 | return -ENOMEM; | 2367 | return res; |
2371 | 2368 | ||
2372 | if ((res = snd_audiodrive_pnpc(dev, card->private_data, pcard, pid)) < 0) { | 2369 | if ((res = snd_audiodrive_pnpc(dev, card->private_data, pcard, pid)) < 0) { |
2373 | snd_card_free(card); | 2370 | snd_card_free(card); |