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>
This commit is contained in:

committed by
Takashi Iwai

orang tua
d453379bc5
melakukan
3e7fb9f7ec
@@ -2125,13 +2125,10 @@ static int __devinit snd_audiodrive_pnpc(int dev, struct snd_audiodrive *acard,
|
||||
#define is_isapnp_selected(dev) 0
|
||||
#endif
|
||||
|
||||
static struct snd_card *snd_es18xx_card_new(int dev)
|
||||
static int snd_es18xx_card_new(int dev, struct snd_card **cardp)
|
||||
{
|
||||
struct snd_card *card;
|
||||
if (snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_audiodrive), &card) < 0)
|
||||
return NULL;
|
||||
return card;
|
||||
return snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_audiodrive), cardp);
|
||||
}
|
||||
|
||||
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)
|
||||
struct snd_card *card;
|
||||
int err;
|
||||
|
||||
card = snd_es18xx_card_new(dev);
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
err = snd_es18xx_card_new(dev, &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
snd_card_set_dev(card, devptr);
|
||||
if ((err = snd_audiodrive_probe(card, dev)) < 0) {
|
||||
snd_card_free(card);
|
||||
@@ -2306,9 +2303,9 @@ static int __devinit snd_audiodrive_pnp_detect(struct pnp_dev *pdev,
|
||||
if (dev >= SNDRV_CARDS)
|
||||
return -ENODEV;
|
||||
|
||||
card = snd_es18xx_card_new(dev);
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
err = snd_es18xx_card_new(dev, &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
if ((err = snd_audiodrive_pnp(dev, card->private_data, pdev)) < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
@@ -2365,9 +2362,9 @@ static int __devinit snd_audiodrive_pnpc_detect(struct pnp_card_link *pcard,
|
||||
if (dev >= SNDRV_CARDS)
|
||||
return -ENODEV;
|
||||
|
||||
card = snd_es18xx_card_new(dev);
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
res = snd_es18xx_card_new(dev, &card);
|
||||
if (res < 0)
|
||||
return res;
|
||||
|
||||
if ((res = snd_audiodrive_pnpc(dev, card->private_data, pcard, pid)) < 0) {
|
||||
snd_card_free(card);
|
||||
|
Reference in New Issue
Block a user