diff options
Diffstat (limited to 'sound/isa/cmi8330.c')
-rw-r--r-- | sound/isa/cmi8330.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c index e49aec700a55..24e60902f8ca 100644 --- a/sound/isa/cmi8330.c +++ b/sound/isa/cmi8330.c | |||
@@ -467,20 +467,22 @@ static int snd_cmi8330_resume(struct snd_card *card) | |||
467 | 467 | ||
468 | #define PFX "cmi8330: " | 468 | #define PFX "cmi8330: " |
469 | 469 | ||
470 | static struct snd_card *snd_cmi8330_card_new(int dev) | 470 | static int snd_cmi8330_card_new(int dev, struct snd_card **cardp) |
471 | { | 471 | { |
472 | struct snd_card *card; | 472 | struct snd_card *card; |
473 | struct snd_cmi8330 *acard; | 473 | struct snd_cmi8330 *acard; |
474 | int err; | ||
474 | 475 | ||
475 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 476 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, |
476 | sizeof(struct snd_cmi8330)); | 477 | sizeof(struct snd_cmi8330), &card); |
477 | if (card == NULL) { | 478 | if (err < 0) { |
478 | snd_printk(KERN_ERR PFX "could not get a new card\n"); | 479 | snd_printk(KERN_ERR PFX "could not get a new card\n"); |
479 | return NULL; | 480 | return err; |
480 | } | 481 | } |
481 | acard = card->private_data; | 482 | acard = card->private_data; |
482 | acard->card = card; | 483 | acard->card = card; |
483 | return card; | 484 | *cardp = card; |
485 | return 0; | ||
484 | } | 486 | } |
485 | 487 | ||
486 | static int __devinit snd_cmi8330_probe(struct snd_card *card, int dev) | 488 | static int __devinit snd_cmi8330_probe(struct snd_card *card, int dev) |
@@ -564,9 +566,9 @@ static int __devinit snd_cmi8330_isa_probe(struct device *pdev, | |||
564 | struct snd_card *card; | 566 | struct snd_card *card; |
565 | int err; | 567 | int err; |
566 | 568 | ||
567 | card = snd_cmi8330_card_new(dev); | 569 | err = snd_cmi8330_card_new(dev, &card); |
568 | if (! card) | 570 | if (err < 0) |
569 | return -ENOMEM; | 571 | return err; |
570 | snd_card_set_dev(card, pdev); | 572 | snd_card_set_dev(card, pdev); |
571 | if ((err = snd_cmi8330_probe(card, dev)) < 0) { | 573 | if ((err = snd_cmi8330_probe(card, dev)) < 0) { |
572 | snd_card_free(card); | 574 | snd_card_free(card); |
@@ -628,9 +630,9 @@ static int __devinit snd_cmi8330_pnp_detect(struct pnp_card_link *pcard, | |||
628 | if (dev >= SNDRV_CARDS) | 630 | if (dev >= SNDRV_CARDS) |
629 | return -ENODEV; | 631 | return -ENODEV; |
630 | 632 | ||
631 | card = snd_cmi8330_card_new(dev); | 633 | res = snd_cmi8330_card_new(dev, &card); |
632 | if (! card) | 634 | if (res < 0) |
633 | return -ENOMEM; | 635 | return res; |
634 | if ((res = snd_cmi8330_pnp(dev, card->private_data, pcard, pid)) < 0) { | 636 | if ((res = snd_cmi8330_pnp(dev, card->private_data, pcard, pid)) < 0) { |
635 | snd_printk(KERN_ERR PFX "PnP detection failed\n"); | 637 | snd_printk(KERN_ERR PFX "PnP detection failed\n"); |
636 | snd_card_free(card); | 638 | snd_card_free(card); |