diff options
Diffstat (limited to 'sound/isa/cs423x/cs4236.c')
-rw-r--r-- | sound/isa/cs423x/cs4236.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c index 019c9401663e..f7845986f467 100644 --- a/sound/isa/cs423x/cs4236.c +++ b/sound/isa/cs423x/cs4236.c | |||
@@ -382,16 +382,18 @@ 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 | ||
385 | static struct snd_card *snd_cs423x_card_new(int dev) | 385 | static 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 | 389 | ||
389 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 390 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, |
390 | sizeof(struct snd_card_cs4236)); | 391 | sizeof(struct snd_card_cs4236), &card); |
391 | if (card == NULL) | 392 | if (err < 0) |
392 | return NULL; | 393 | return err; |
393 | card->private_free = snd_card_cs4236_free; | 394 | card->private_free = snd_card_cs4236_free; |
394 | return card; | 395 | *cardp = card; |
396 | return 0; | ||
395 | } | 397 | } |
396 | 398 | ||
397 | static int __devinit snd_cs423x_probe(struct snd_card *card, int dev) | 399 | static int __devinit snd_cs423x_probe(struct snd_card *card, int dev) |
@@ -512,9 +514,9 @@ static int __devinit snd_cs423x_isa_probe(struct device *pdev, | |||
512 | struct snd_card *card; | 514 | struct snd_card *card; |
513 | int err; | 515 | int err; |
514 | 516 | ||
515 | card = snd_cs423x_card_new(dev); | 517 | err = snd_cs423x_card_new(dev, &card); |
516 | if (! card) | 518 | if (err < 0) |
517 | return -ENOMEM; | 519 | return err; |
518 | snd_card_set_dev(card, pdev); | 520 | snd_card_set_dev(card, pdev); |
519 | if ((err = snd_cs423x_probe(card, dev)) < 0) { | 521 | if ((err = snd_cs423x_probe(card, dev)) < 0) { |
520 | snd_card_free(card); | 522 | snd_card_free(card); |
@@ -594,9 +596,9 @@ static int __devinit snd_cs4232_pnpbios_detect(struct pnp_dev *pdev, | |||
594 | if (dev >= SNDRV_CARDS) | 596 | if (dev >= SNDRV_CARDS) |
595 | return -ENODEV; | 597 | return -ENODEV; |
596 | 598 | ||
597 | card = snd_cs423x_card_new(dev); | 599 | err = snd_cs423x_card_new(dev, &card); |
598 | if (! card) | 600 | if (err < 0) |
599 | return -ENOMEM; | 601 | return err; |
600 | 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) { |
601 | printk(KERN_ERR "PnP BIOS detection failed for " IDENT "\n"); | 603 | printk(KERN_ERR "PnP BIOS detection failed for " IDENT "\n"); |
602 | snd_card_free(card); | 604 | snd_card_free(card); |
@@ -656,9 +658,9 @@ static int __devinit snd_cs423x_pnpc_detect(struct pnp_card_link *pcard, | |||
656 | if (dev >= SNDRV_CARDS) | 658 | if (dev >= SNDRV_CARDS) |
657 | return -ENODEV; | 659 | return -ENODEV; |
658 | 660 | ||
659 | card = snd_cs423x_card_new(dev); | 661 | res = snd_cs423x_card_new(dev, &card); |
660 | if (! card) | 662 | if (res < 0) |
661 | return -ENOMEM; | 663 | return res; |
662 | 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) { |
663 | printk(KERN_ERR "isapnp detection failed and probing for " IDENT | 665 | printk(KERN_ERR "isapnp detection failed and probing for " IDENT |
664 | " is not supported\n"); | 666 | " is not supported\n"); |