aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/gus
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
parent4c9f1d3ed7e5f910b66dc4d1456cfac17e58cf0e (diff)
parentb1a0aac05f044e78a589bfd7a9e2334aa640eb45 (diff)
Merge branch 'topic/snd_card_new-err' into topic/cs423x-merge
Diffstat (limited to 'sound/isa/gus')
-rw-r--r--sound/isa/gus/gusclassic.c6
-rw-r--r--sound/isa/gus/gusextreme.c6
-rw-r--r--sound/isa/gus/gusmax.c8
-rw-r--r--sound/isa/gus/interwave.c26
4 files changed, 24 insertions, 22 deletions
diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c
index 426532a4d730..086b8f0e0f94 100644
--- a/sound/isa/gus/gusclassic.c
+++ b/sound/isa/gus/gusclassic.c
@@ -148,9 +148,9 @@ static int __devinit snd_gusclassic_probe(struct device *dev, unsigned int n)
148 struct snd_gus_card *gus; 148 struct snd_gus_card *gus;
149 int error; 149 int error;
150 150
151 card = snd_card_new(index[n], id[n], THIS_MODULE, 0); 151 error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card);
152 if (!card) 152 if (error < 0)
153 return -EINVAL; 153 return error;
154 154
155 if (pcm_channels[n] < 2) 155 if (pcm_channels[n] < 2)
156 pcm_channels[n] = 2; 156 pcm_channels[n] = 2;
diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c
index 7ad4c3b41a84..180a8dea6bd9 100644
--- a/sound/isa/gus/gusextreme.c
+++ b/sound/isa/gus/gusextreme.c
@@ -241,9 +241,9 @@ static int __devinit snd_gusextreme_probe(struct device *dev, unsigned int n)
241 struct snd_opl3 *opl3; 241 struct snd_opl3 *opl3;
242 int error; 242 int error;
243 243
244 card = snd_card_new(index[n], id[n], THIS_MODULE, 0); 244 error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card);
245 if (!card) 245 if (error < 0)
246 return -EINVAL; 246 return error;
247 247
248 if (mpu_port[n] == SNDRV_AUTO_PORT) 248 if (mpu_port[n] == SNDRV_AUTO_PORT)
249 mpu_port[n] = 0; 249 mpu_port[n] = 0;
diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c
index f94c1976e632..f26eac8d8110 100644
--- a/sound/isa/gus/gusmax.c
+++ b/sound/isa/gus/gusmax.c
@@ -214,10 +214,10 @@ static int __devinit snd_gusmax_probe(struct device *pdev, unsigned int dev)
214 struct snd_wss *wss; 214 struct snd_wss *wss;
215 struct snd_gusmax *maxcard; 215 struct snd_gusmax *maxcard;
216 216
217 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 217 err = snd_card_create(index[dev], id[dev], THIS_MODULE,
218 sizeof(struct snd_gusmax)); 218 sizeof(struct snd_gusmax), &card);
219 if (card == NULL) 219 if (err < 0)
220 return -ENOMEM; 220 return err;
221 card->private_free = snd_gusmax_free; 221 card->private_free = snd_gusmax_free;
222 maxcard = (struct snd_gusmax *)card->private_data; 222 maxcard = (struct snd_gusmax *)card->private_data;
223 maxcard->card = card; 223 maxcard->card = card;
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);