aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/cs423x
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/cs423x
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/cs423x')
-rw-r--r--sound/isa/cs423x/cs4236.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c
index db830682804f..f7845986f467 100644
--- a/sound/isa/cs423x/cs4236.c
+++ b/sound/isa/cs423x/cs4236.c
@@ -382,7 +382,7 @@ static void snd_card_cs4236_free(struct snd_card *card)
382 release_and_free_resource(acard->res_sb_port); 382 release_and_free_resource(acard->res_sb_port);
383} 383}
384 384
385static struct snd_card *snd_cs423x_card_new(int dev) 385static int snd_cs423x_card_new(int dev, struct snd_card **cardp)
386{ 386{
387 struct snd_card *card; 387 struct snd_card *card;
388 int err; 388 int err;
@@ -390,9 +390,10 @@ static struct snd_card *snd_cs423x_card_new(int dev)
390 err = snd_card_create(index[dev], id[dev], THIS_MODULE, 390 err = snd_card_create(index[dev], id[dev], THIS_MODULE,
391 sizeof(struct snd_card_cs4236), &card); 391 sizeof(struct snd_card_cs4236), &card);
392 if (err < 0) 392 if (err < 0)
393 return NULL; 393 return err;
394 card->private_free = snd_card_cs4236_free; 394 card->private_free = snd_card_cs4236_free;
395 return card; 395 *cardp = card;
396 return 0;
396} 397}
397 398
398static int __devinit snd_cs423x_probe(struct snd_card *card, int dev) 399static int __devinit snd_cs423x_probe(struct snd_card *card, int dev)
@@ -513,9 +514,9 @@ static int __devinit snd_cs423x_isa_probe(struct device *pdev,
513 struct snd_card *card; 514 struct snd_card *card;
514 int err; 515 int err;
515 516
516 card = snd_cs423x_card_new(dev); 517 err = snd_cs423x_card_new(dev, &card);
517 if (! card) 518 if (err < 0)
518 return -ENOMEM; 519 return err;
519 snd_card_set_dev(card, pdev); 520 snd_card_set_dev(card, pdev);
520 if ((err = snd_cs423x_probe(card, dev)) < 0) { 521 if ((err = snd_cs423x_probe(card, dev)) < 0) {
521 snd_card_free(card); 522 snd_card_free(card);
@@ -595,9 +596,9 @@ static int __devinit snd_cs4232_pnpbios_detect(struct pnp_dev *pdev,
595 if (dev >= SNDRV_CARDS) 596 if (dev >= SNDRV_CARDS)
596 return -ENODEV; 597 return -ENODEV;
597 598
598 card = snd_cs423x_card_new(dev); 599 err = snd_cs423x_card_new(dev, &card);
599 if (! card) 600 if (err < 0)
600 return -ENOMEM; 601 return err;
601 if ((err = snd_card_cs4232_pnp(dev, card->private_data, pdev)) < 0) { 602 if ((err = snd_card_cs4232_pnp(dev, card->private_data, pdev)) < 0) {
602 printk(KERN_ERR "PnP BIOS detection failed for " IDENT "\n"); 603 printk(KERN_ERR "PnP BIOS detection failed for " IDENT "\n");
603 snd_card_free(card); 604 snd_card_free(card);
@@ -657,9 +658,9 @@ static int __devinit snd_cs423x_pnpc_detect(struct pnp_card_link *pcard,
657 if (dev >= SNDRV_CARDS) 658 if (dev >= SNDRV_CARDS)
658 return -ENODEV; 659 return -ENODEV;
659 660
660 card = snd_cs423x_card_new(dev); 661 res = snd_cs423x_card_new(dev, &card);
661 if (! card) 662 if (res < 0)
662 return -ENOMEM; 663 return res;
663 if ((res = snd_card_cs423x_pnpc(dev, card->private_data, pcard, pid)) < 0) { 664 if ((res = snd_card_cs423x_pnpc(dev, card->private_data, pcard, pid)) < 0) {
664 printk(KERN_ERR "isapnp detection failed and probing for " IDENT 665 printk(KERN_ERR "isapnp detection failed and probing for " IDENT
665 " is not supported\n"); 666 " is not supported\n");