aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/opl3sa2.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@alsa3.local>2008-12-28 10:43:35 -0500
committerTakashi Iwai <tiwai@suse.de>2009-01-12 09:20:26 -0500
commitc95eadd2f1afd2ba643e85a8dfc9079a3f03ae47 (patch)
tree1fb2defba2bf3d4c299395b0f46d7902eb3b51ba /sound/isa/opl3sa2.c
parent53fb1e63599438bd5f6fbb852023d80916d83983 (diff)
ALSA: Convert to snd_card_create() in sound/isa/*
Convert from snd_card_new() to the new snd_card_create() function. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa/opl3sa2.c')
-rw-r--r--sound/isa/opl3sa2.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c
index 58c972b2af03..645491a53023 100644
--- a/sound/isa/opl3sa2.c
+++ b/sound/isa/opl3sa2.c
@@ -617,21 +617,24 @@ static void snd_opl3sa2_free(struct snd_card *card)
617 release_and_free_resource(chip->res_port); 617 release_and_free_resource(chip->res_port);
618} 618}
619 619
620static struct snd_card *snd_opl3sa2_card_new(int dev) 620static int snd_opl3sa2_card_new(int dev, struct snd_card **cardp)
621{ 621{
622 struct snd_card *card; 622 struct snd_card *card;
623 struct snd_opl3sa2 *chip; 623 struct snd_opl3sa2 *chip;
624 int err;
624 625
625 card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(struct snd_opl3sa2)); 626 err = snd_card_create(index[dev], id[dev], THIS_MODULE,
626 if (card == NULL) 627 sizeof(struct snd_opl3sa2), &card);
627 return NULL; 628 if (err < 0)
629 return err;
628 strcpy(card->driver, "OPL3SA2"); 630 strcpy(card->driver, "OPL3SA2");
629 strcpy(card->shortname, "Yamaha OPL3-SA2"); 631 strcpy(card->shortname, "Yamaha OPL3-SA2");
630 chip = card->private_data; 632 chip = card->private_data;
631 spin_lock_init(&chip->reg_lock); 633 spin_lock_init(&chip->reg_lock);
632 chip->irq = -1; 634 chip->irq = -1;
633 card->private_free = snd_opl3sa2_free; 635 card->private_free = snd_opl3sa2_free;
634 return card; 636 *cardp = card;
637 return 0;
635} 638}
636 639
637static int __devinit snd_opl3sa2_probe(struct snd_card *card, int dev) 640static int __devinit snd_opl3sa2_probe(struct snd_card *card, int dev)
@@ -723,9 +726,9 @@ static int __devinit snd_opl3sa2_pnp_detect(struct pnp_dev *pdev,
723 if (dev >= SNDRV_CARDS) 726 if (dev >= SNDRV_CARDS)
724 return -ENODEV; 727 return -ENODEV;
725 728
726 card = snd_opl3sa2_card_new(dev); 729 err = snd_opl3sa2_card_new(dev, &card);
727 if (! card) 730 if (err < 0)
728 return -ENOMEM; 731 return err;
729 if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) { 732 if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) {
730 snd_card_free(card); 733 snd_card_free(card);
731 return err; 734 return err;
@@ -789,9 +792,9 @@ static int __devinit snd_opl3sa2_pnp_cdetect(struct pnp_card_link *pcard,
789 if (dev >= SNDRV_CARDS) 792 if (dev >= SNDRV_CARDS)
790 return -ENODEV; 793 return -ENODEV;
791 794
792 card = snd_opl3sa2_card_new(dev); 795 err = snd_opl3sa2_card_new(dev, &card);
793 if (! card) 796 if (err < 0)
794 return -ENOMEM; 797 return err;
795 if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) { 798 if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) {
796 snd_card_free(card); 799 snd_card_free(card);
797 return err; 800 return err;
@@ -870,9 +873,9 @@ static int __devinit snd_opl3sa2_isa_probe(struct device *pdev,
870 struct snd_card *card; 873 struct snd_card *card;
871 int err; 874 int err;
872 875
873 card = snd_opl3sa2_card_new(dev); 876 err = snd_opl3sa2_card_new(dev, &card);
874 if (! card) 877 if (err < 0)
875 return -ENOMEM; 878 return err;
876 snd_card_set_dev(card, pdev); 879 snd_card_set_dev(card, pdev);
877 if ((err = snd_opl3sa2_probe(card, dev)) < 0) { 880 if ((err = snd_opl3sa2_probe(card, dev)) < 0) {
878 snd_card_free(card); 881 snd_card_free(card);