aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/opti9xx/opti92x-ad1848.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/opti9xx/opti92x-ad1848.c')
-rw-r--r--sound/isa/opti9xx/opti92x-ad1848.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c
index 19706b0d8497..cd6e60a6a4ea 100644
--- a/sound/isa/opti9xx/opti92x-ad1848.c
+++ b/sound/isa/opti9xx/opti92x-ad1848.c
@@ -830,15 +830,18 @@ static int __devinit snd_opti9xx_probe(struct snd_card *card)
830 return snd_card_register(card); 830 return snd_card_register(card);
831} 831}
832 832
833static struct snd_card *snd_opti9xx_card_new(void) 833static int snd_opti9xx_card_new(struct snd_card **cardp)
834{ 834{
835 struct snd_card *card; 835 struct snd_card *card;
836 int err;
836 837
837 card = snd_card_new(index, id, THIS_MODULE, sizeof(struct snd_opti9xx)); 838 err = snd_card_create(index, id, THIS_MODULE,
838 if (! card) 839 sizeof(struct snd_opti9xx), &card);
839 return NULL; 840 if (err < 0)
841 return err;
840 card->private_free = snd_card_opti9xx_free; 842 card->private_free = snd_card_opti9xx_free;
841 return card; 843 *cardp = card;
844 return 0;
842} 845}
843 846
844static int __devinit snd_opti9xx_isa_match(struct device *devptr, 847static int __devinit snd_opti9xx_isa_match(struct device *devptr,
@@ -903,9 +906,9 @@ static int __devinit snd_opti9xx_isa_probe(struct device *devptr,
903 } 906 }
904#endif 907#endif
905 908
906 card = snd_opti9xx_card_new(); 909 error = snd_opti9xx_card_new(&card);
907 if (! card) 910 if (error < 0)
908 return -ENOMEM; 911 return error;
909 912
910 if ((error = snd_card_opti9xx_detect(card, card->private_data)) < 0) { 913 if ((error = snd_card_opti9xx_detect(card, card->private_data)) < 0) {
911 snd_card_free(card); 914 snd_card_free(card);
@@ -950,9 +953,9 @@ static int __devinit snd_opti9xx_pnp_probe(struct pnp_card_link *pcard,
950 return -EBUSY; 953 return -EBUSY;
951 if (! isapnp) 954 if (! isapnp)
952 return -ENODEV; 955 return -ENODEV;
953 card = snd_opti9xx_card_new(); 956 error = snd_opti9xx_card_new(&card);
954 if (! card) 957 if (error < 0)
955 return -ENOMEM; 958 return error;
956 chip = card->private_data; 959 chip = card->private_data;
957 960
958 hw = snd_card_opti9xx_pnp(chip, pcard, pid); 961 hw = snd_card_opti9xx_pnp(chip, pcard, pid);