aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/gus/interwave.c
diff options
context:
space:
mode:
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 5faecfb602d3..50e429a120da 100644
--- a/sound/isa/gus/interwave.c
+++ b/sound/isa/gus/interwave.c
@@ -626,20 +626,22 @@ static void snd_interwave_free(struct snd_card *card)
626 free_irq(iwcard->irq, (void *)iwcard); 626 free_irq(iwcard->irq, (void *)iwcard);
627} 627}
628 628
629static struct snd_card *snd_interwave_card_new(int dev) 629static int snd_interwave_card_new(int dev, struct snd_card **cardp)
630{ 630{
631 struct snd_card *card; 631 struct snd_card *card;
632 struct snd_interwave *iwcard; 632 struct snd_interwave *iwcard;
633 int err;
633 634
634 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 635 err = snd_card_create(index[dev], id[dev], THIS_MODULE,
635 sizeof(struct snd_interwave)); 636 sizeof(struct snd_interwave), &card);
636 if (card == NULL) 637 if (err < 0)
637 return NULL; 638 return err;
638 iwcard = card->private_data; 639 iwcard = card->private_data;
639 iwcard->card = card; 640 iwcard->card = card;
640 iwcard->irq = -1; 641 iwcard->irq = -1;
641 card->private_free = snd_interwave_free; 642 card->private_free = snd_interwave_free;
642 return card; 643 *cardp = card;
644 return 0;
643} 645}
644 646
645static int __devinit snd_interwave_probe(struct snd_card *card, int dev) 647static int __devinit snd_interwave_probe(struct snd_card *card, int dev)
@@ -778,9 +780,9 @@ static int __devinit snd_interwave_isa_probe1(int dev, struct device *devptr)
778 struct snd_card *card; 780 struct snd_card *card;
779 int err; 781 int err;
780 782
781 card = snd_interwave_card_new(dev); 783 err = snd_interwave_card_new(dev, &card);
782 if (! card) 784 if (err < 0)
783 return -ENOMEM; 785 return err;
784 786
785 snd_card_set_dev(card, devptr); 787 snd_card_set_dev(card, devptr);
786 if ((err = snd_interwave_probe(card, dev)) < 0) { 788 if ((err = snd_interwave_probe(card, dev)) < 0) {
@@ -876,9 +878,9 @@ static int __devinit snd_interwave_pnp_detect(struct pnp_card_link *pcard,
876 if (dev >= SNDRV_CARDS) 878 if (dev >= SNDRV_CARDS)
877 return -ENODEV; 879 return -ENODEV;
878 880
879 card = snd_interwave_card_new(dev); 881 res = snd_interwave_card_new(dev, &card);
880 if (! card) 882 if (res < 0)
881 return -ENOMEM; 883 return res;
882 884
883 if ((res = snd_interwave_pnp(dev, card->private_data, pcard, pid)) < 0) { 885 if ((res = snd_interwave_pnp(dev, card->private_data, pcard, pid)) < 0) {
884 snd_card_free(card); 886 snd_card_free(card);