aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/gus/interwave.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-02-16 17:03:57 -0500
committerTakashi Iwai <tiwai@suse.de>2009-02-16 17:03:57 -0500
commit96cf45cf559be375de29dd45afc50fa8946fb2aa (patch)
tree06242d4256aadc01aee67dfafbb94541e7a17738 /sound/isa/gus/interwave.c
parent4c9f1d3ed7e5f910b66dc4d1456cfac17e58cf0e (diff)
parentb1a0aac05f044e78a589bfd7a9e2334aa640eb45 (diff)
Merge branch 'topic/snd_card_new-err' into topic/cs423x-merge
Diffstat (limited to 'sound/isa/gus/interwave.c')
-rw-r--r--sound/isa/gus/interwave.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c
index 418d49eef926..534a6eced2b8 100644
--- a/sound/isa/gus/interwave.c
+++ b/sound/isa/gus/interwave.c
@@ -628,20 +628,22 @@ static void snd_interwave_free(struct snd_card *card)
628 free_irq(iwcard->irq, (void *)iwcard); 628 free_irq(iwcard->irq, (void *)iwcard);
629} 629}
630 630
631static struct snd_card *snd_interwave_card_new(int dev) 631static int snd_interwave_card_new(int dev, struct snd_card **cardp)
632{ 632{
633 struct snd_card *card; 633 struct snd_card *card;
634 struct snd_interwave *iwcard; 634 struct snd_interwave *iwcard;
635 int err;
635 636
636 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 637 err = snd_card_create(index[dev], id[dev], THIS_MODULE,
637 sizeof(struct snd_interwave)); 638 sizeof(struct snd_interwave), &card);
638 if (card == NULL) 639 if (err < 0)
639 return NULL; 640 return err;
640 iwcard = card->private_data; 641 iwcard = card->private_data;
641 iwcard->card = card; 642 iwcard->card = card;
642 iwcard->irq = -1; 643 iwcard->irq = -1;
643 card->private_free = snd_interwave_free; 644 card->private_free = snd_interwave_free;
644 return card; 645 *cardp = card;
646 return 0;
645} 647}
646 648
647static int __devinit snd_interwave_probe(struct snd_card *card, int dev) 649static int __devinit snd_interwave_probe(struct snd_card *card, int dev)
@@ -780,9 +782,9 @@ static int __devinit snd_interwave_isa_probe1(int dev, struct device *devptr)
780 struct snd_card *card; 782 struct snd_card *card;
781 int err; 783 int err;
782 784
783 card = snd_interwave_card_new(dev); 785 err = snd_interwave_card_new(dev, &card);
784 if (! card) 786 if (err < 0)
785 return -ENOMEM; 787 return err;
786 788
787 snd_card_set_dev(card, devptr); 789 snd_card_set_dev(card, devptr);
788 if ((err = snd_interwave_probe(card, dev)) < 0) { 790 if ((err = snd_interwave_probe(card, dev)) < 0) {
@@ -878,9 +880,9 @@ static int __devinit snd_interwave_pnp_detect(struct pnp_card_link *pcard,
878 if (dev >= SNDRV_CARDS) 880 if (dev >= SNDRV_CARDS)
879 return -ENODEV; 881 return -ENODEV;
880 882
881 card = snd_interwave_card_new(dev); 883 res = snd_interwave_card_new(dev, &card);
882 if (! card) 884 if (res < 0)
883 return -ENOMEM; 885 return res;
884 886
885 if ((res = snd_interwave_pnp(dev, card->private_data, pcard, pid)) < 0) { 887 if ((res = snd_interwave_pnp(dev, card->private_data, pcard, pid)) < 0) {
886 snd_card_free(card); 888 snd_card_free(card);