diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-02-16 17:03:57 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-02-16 17:03:57 -0500 |
commit | 96cf45cf559be375de29dd45afc50fa8946fb2aa (patch) | |
tree | 06242d4256aadc01aee67dfafbb94541e7a17738 /sound/isa/cmi8330.c | |
parent | 4c9f1d3ed7e5f910b66dc4d1456cfac17e58cf0e (diff) | |
parent | b1a0aac05f044e78a589bfd7a9e2334aa640eb45 (diff) |
Merge branch 'topic/snd_card_new-err' into topic/cs423x-merge
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 9ca8122f7ba2..de83608719ea 100644 --- a/sound/isa/cmi8330.c +++ b/sound/isa/cmi8330.c | |||
@@ -497,20 +497,22 @@ static int snd_cmi8330_resume(struct snd_card *card) | |||
497 | 497 | ||
498 | #define PFX "cmi8330: " | 498 | #define PFX "cmi8330: " |
499 | 499 | ||
500 | static struct snd_card *snd_cmi8330_card_new(int dev) | 500 | static int snd_cmi8330_card_new(int dev, struct snd_card **cardp) |
501 | { | 501 | { |
502 | struct snd_card *card; | 502 | struct snd_card *card; |
503 | struct snd_cmi8330 *acard; | 503 | struct snd_cmi8330 *acard; |
504 | int err; | ||
504 | 505 | ||
505 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 506 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, |
506 | sizeof(struct snd_cmi8330)); | 507 | sizeof(struct snd_cmi8330), &card); |
507 | if (card == NULL) { | 508 | if (err < 0) { |
508 | snd_printk(KERN_ERR PFX "could not get a new card\n"); | 509 | snd_printk(KERN_ERR PFX "could not get a new card\n"); |
509 | return NULL; | 510 | return err; |
510 | } | 511 | } |
511 | acard = card->private_data; | 512 | acard = card->private_data; |
512 | acard->card = card; | 513 | acard->card = card; |
513 | return card; | 514 | *cardp = card; |
515 | return 0; | ||
514 | } | 516 | } |
515 | 517 | ||
516 | static int __devinit snd_cmi8330_probe(struct snd_card *card, int dev) | 518 | static int __devinit snd_cmi8330_probe(struct snd_card *card, int dev) |
@@ -616,9 +618,9 @@ static int __devinit snd_cmi8330_isa_probe(struct device *pdev, | |||
616 | struct snd_card *card; | 618 | struct snd_card *card; |
617 | int err; | 619 | int err; |
618 | 620 | ||
619 | card = snd_cmi8330_card_new(dev); | 621 | err = snd_cmi8330_card_new(dev, &card); |
620 | if (! card) | 622 | if (err < 0) |
621 | return -ENOMEM; | 623 | return err; |
622 | snd_card_set_dev(card, pdev); | 624 | snd_card_set_dev(card, pdev); |
623 | if ((err = snd_cmi8330_probe(card, dev)) < 0) { | 625 | if ((err = snd_cmi8330_probe(card, dev)) < 0) { |
624 | snd_card_free(card); | 626 | snd_card_free(card); |
@@ -680,9 +682,9 @@ static int __devinit snd_cmi8330_pnp_detect(struct pnp_card_link *pcard, | |||
680 | if (dev >= SNDRV_CARDS) | 682 | if (dev >= SNDRV_CARDS) |
681 | return -ENODEV; | 683 | return -ENODEV; |
682 | 684 | ||
683 | card = snd_cmi8330_card_new(dev); | 685 | res = snd_cmi8330_card_new(dev, &card); |
684 | if (! card) | 686 | if (res < 0) |
685 | return -ENOMEM; | 687 | return res; |
686 | if ((res = snd_cmi8330_pnp(dev, card->private_data, pcard, pid)) < 0) { | 688 | if ((res = snd_cmi8330_pnp(dev, card->private_data, pcard, pid)) < 0) { |
687 | snd_printk(KERN_ERR PFX "PnP detection failed\n"); | 689 | snd_printk(KERN_ERR PFX "PnP detection failed\n"); |
688 | snd_card_free(card); | 690 | snd_card_free(card); |