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/cs423x | |
parent | 4c9f1d3ed7e5f910b66dc4d1456cfac17e58cf0e (diff) | |
parent | b1a0aac05f044e78a589bfd7a9e2334aa640eb45 (diff) |
Merge branch 'topic/snd_card_new-err' into topic/cs423x-merge
Diffstat (limited to 'sound/isa/cs423x')
-rw-r--r-- | sound/isa/cs423x/cs4231.c | 6 | ||||
-rw-r--r-- | sound/isa/cs423x/cs4236.c | 32 |
2 files changed, 20 insertions, 18 deletions
diff --git a/sound/isa/cs423x/cs4231.c b/sound/isa/cs423x/cs4231.c index f019d449e2d6..cb9153e75b82 100644 --- a/sound/isa/cs423x/cs4231.c +++ b/sound/isa/cs423x/cs4231.c | |||
@@ -95,9 +95,9 @@ static int __devinit snd_cs4231_probe(struct device *dev, unsigned int n) | |||
95 | struct snd_pcm *pcm; | 95 | struct snd_pcm *pcm; |
96 | int error; | 96 | int error; |
97 | 97 | ||
98 | card = snd_card_new(index[n], id[n], THIS_MODULE, 0); | 98 | error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card); |
99 | if (!card) | 99 | if (error < 0) |
100 | return -EINVAL; | 100 | return error; |
101 | 101 | ||
102 | error = snd_wss_create(card, port[n], -1, irq[n], dma1[n], dma2[n], | 102 | error = snd_wss_create(card, port[n], -1, irq[n], dma1[n], dma2[n], |
103 | WSS_HW_DETECT, 0, &chip); | 103 | WSS_HW_DETECT, 0, &chip); |
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c index 019c9401663e..f7845986f467 100644 --- a/sound/isa/cs423x/cs4236.c +++ b/sound/isa/cs423x/cs4236.c | |||
@@ -382,16 +382,18 @@ static void snd_card_cs4236_free(struct snd_card *card) | |||
382 | release_and_free_resource(acard->res_sb_port); | 382 | release_and_free_resource(acard->res_sb_port); |
383 | } | 383 | } |
384 | 384 | ||
385 | static struct snd_card *snd_cs423x_card_new(int dev) | 385 | static int snd_cs423x_card_new(int dev, struct snd_card **cardp) |
386 | { | 386 | { |
387 | struct snd_card *card; | 387 | struct snd_card *card; |
388 | int err; | ||
388 | 389 | ||
389 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 390 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, |
390 | sizeof(struct snd_card_cs4236)); | 391 | sizeof(struct snd_card_cs4236), &card); |
391 | if (card == NULL) | 392 | if (err < 0) |
392 | return NULL; | 393 | return err; |
393 | card->private_free = snd_card_cs4236_free; | 394 | card->private_free = snd_card_cs4236_free; |
394 | return card; | 395 | *cardp = card; |
396 | return 0; | ||
395 | } | 397 | } |
396 | 398 | ||
397 | static int __devinit snd_cs423x_probe(struct snd_card *card, int dev) | 399 | static int __devinit snd_cs423x_probe(struct snd_card *card, int dev) |
@@ -512,9 +514,9 @@ static int __devinit snd_cs423x_isa_probe(struct device *pdev, | |||
512 | struct snd_card *card; | 514 | struct snd_card *card; |
513 | int err; | 515 | int err; |
514 | 516 | ||
515 | card = snd_cs423x_card_new(dev); | 517 | err = snd_cs423x_card_new(dev, &card); |
516 | if (! card) | 518 | if (err < 0) |
517 | return -ENOMEM; | 519 | return err; |
518 | snd_card_set_dev(card, pdev); | 520 | snd_card_set_dev(card, pdev); |
519 | if ((err = snd_cs423x_probe(card, dev)) < 0) { | 521 | if ((err = snd_cs423x_probe(card, dev)) < 0) { |
520 | snd_card_free(card); | 522 | snd_card_free(card); |
@@ -594,9 +596,9 @@ static int __devinit snd_cs4232_pnpbios_detect(struct pnp_dev *pdev, | |||
594 | if (dev >= SNDRV_CARDS) | 596 | if (dev >= SNDRV_CARDS) |
595 | return -ENODEV; | 597 | return -ENODEV; |
596 | 598 | ||
597 | card = snd_cs423x_card_new(dev); | 599 | err = snd_cs423x_card_new(dev, &card); |
598 | if (! card) | 600 | if (err < 0) |
599 | return -ENOMEM; | 601 | return err; |
600 | if ((err = snd_card_cs4232_pnp(dev, card->private_data, pdev)) < 0) { | 602 | if ((err = snd_card_cs4232_pnp(dev, card->private_data, pdev)) < 0) { |
601 | printk(KERN_ERR "PnP BIOS detection failed for " IDENT "\n"); | 603 | printk(KERN_ERR "PnP BIOS detection failed for " IDENT "\n"); |
602 | snd_card_free(card); | 604 | snd_card_free(card); |
@@ -656,9 +658,9 @@ static int __devinit snd_cs423x_pnpc_detect(struct pnp_card_link *pcard, | |||
656 | if (dev >= SNDRV_CARDS) | 658 | if (dev >= SNDRV_CARDS) |
657 | return -ENODEV; | 659 | return -ENODEV; |
658 | 660 | ||
659 | card = snd_cs423x_card_new(dev); | 661 | res = snd_cs423x_card_new(dev, &card); |
660 | if (! card) | 662 | if (res < 0) |
661 | return -ENOMEM; | 663 | return res; |
662 | if ((res = snd_card_cs423x_pnpc(dev, card->private_data, pcard, pid)) < 0) { | 664 | if ((res = snd_card_cs423x_pnpc(dev, card->private_data, pcard, pid)) < 0) { |
663 | printk(KERN_ERR "isapnp detection failed and probing for " IDENT | 665 | printk(KERN_ERR "isapnp detection failed and probing for " IDENT |
664 | " is not supported\n"); | 666 | " is not supported\n"); |