aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/wavefront/wavefront.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/wavefront/wavefront.c')
-rw-r--r--sound/isa/wavefront/wavefront.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c
index 4c095bc7c729..95898b2b7b58 100644
--- a/sound/isa/wavefront/wavefront.c
+++ b/sound/isa/wavefront/wavefront.c
@@ -338,15 +338,16 @@ snd_wavefront_free(struct snd_card *card)
338 } 338 }
339} 339}
340 340
341static struct snd_card *snd_wavefront_card_new(int dev) 341static int snd_wavefront_card_new(int dev, struct snd_card **cardp)
342{ 342{
343 struct snd_card *card; 343 struct snd_card *card;
344 snd_wavefront_card_t *acard; 344 snd_wavefront_card_t *acard;
345 int err;
345 346
346 card = snd_card_new (index[dev], id[dev], THIS_MODULE, 347 err = snd_card_create(index[dev], id[dev], THIS_MODULE,
347 sizeof(snd_wavefront_card_t)); 348 sizeof(snd_wavefront_card_t), &card);
348 if (card == NULL) 349 if (err < 0)
349 return NULL; 350 return err;
350 351
351 acard = card->private_data; 352 acard = card->private_data;
352 acard->wavefront.irq = -1; 353 acard->wavefront.irq = -1;
@@ -357,7 +358,8 @@ static struct snd_card *snd_wavefront_card_new(int dev)
357 acard->wavefront.card = card; 358 acard->wavefront.card = card;
358 card->private_free = snd_wavefront_free; 359 card->private_free = snd_wavefront_free;
359 360
360 return card; 361 *cardp = card;
362 return 0;
361} 363}
362 364
363static int __devinit 365static int __devinit
@@ -567,9 +569,9 @@ static int __devinit snd_wavefront_isa_probe(struct device *pdev,
567 struct snd_card *card; 569 struct snd_card *card;
568 int err; 570 int err;
569 571
570 card = snd_wavefront_card_new(dev); 572 err = snd_wavefront_card_new(dev, &card);
571 if (! card) 573 if (err < 0)
572 return -ENOMEM; 574 return err;
573 snd_card_set_dev(card, pdev); 575 snd_card_set_dev(card, pdev);
574 if ((err = snd_wavefront_probe(card, dev)) < 0) { 576 if ((err = snd_wavefront_probe(card, dev)) < 0) {
575 snd_card_free(card); 577 snd_card_free(card);
@@ -616,9 +618,9 @@ static int __devinit snd_wavefront_pnp_detect(struct pnp_card_link *pcard,
616 if (dev >= SNDRV_CARDS) 618 if (dev >= SNDRV_CARDS)
617 return -ENODEV; 619 return -ENODEV;
618 620
619 card = snd_wavefront_card_new(dev); 621 res = snd_wavefront_card_new(dev, &card);
620 if (! card) 622 if (res < 0)
621 return -ENOMEM; 623 return res;
622 624
623 if (snd_wavefront_pnp (dev, card->private_data, pcard, pid) < 0) { 625 if (snd_wavefront_pnp (dev, card->private_data, pcard, pid) < 0) {
624 if (cs4232_pcm_port[dev] == SNDRV_AUTO_PORT) { 626 if (cs4232_pcm_port[dev] == SNDRV_AUTO_PORT) {