]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/isa/opti9xx/opti92x-ad1848.c
Merge branch 'topic/snd_card_new-err' into topic/cs423x-merge
[linux-2.6-omap-h63xx.git] / sound / isa / opti9xx / opti92x-ad1848.c
index d5bc0e03132ad194f37ccceb8f4a63b36519bbd9..5cd555325b9d443285d2d00138e9b990a33169c8 100644 (file)
@@ -828,15 +828,18 @@ static int __devinit snd_opti9xx_probe(struct snd_card *card)
        return snd_card_register(card);
 }
 
-static struct snd_card *snd_opti9xx_card_new(void)
+static int snd_opti9xx_card_new(struct snd_card **cardp)
 {
        struct snd_card *card;
+       int err;
 
-       card = snd_card_new(index, id, THIS_MODULE, sizeof(struct snd_opti9xx));
-       if (! card)
-               return NULL;
+       err = snd_card_create(index, id, THIS_MODULE,
+                             sizeof(struct snd_opti9xx), &card);
+       if (err < 0)
+               return err;
        card->private_free = snd_card_opti9xx_free;
-       return card;
+       *cardp = card;
+       return 0;
 }
 
 static int __devinit snd_opti9xx_isa_match(struct device *devptr,
@@ -901,9 +904,9 @@ static int __devinit snd_opti9xx_isa_probe(struct device *devptr,
        }
 #endif
 
-       card = snd_opti9xx_card_new();
-       if (! card)
-               return -ENOMEM;
+       error = snd_opti9xx_card_new(&card);
+       if (error < 0)
+               return error;
 
        if ((error = snd_card_opti9xx_detect(card, card->private_data)) < 0) {
                snd_card_free(card);
@@ -948,9 +951,9 @@ static int __devinit snd_opti9xx_pnp_probe(struct pnp_card_link *pcard,
                return -EBUSY;
        if (! isapnp)
                return -ENODEV;
-       card = snd_opti9xx_card_new();
-       if (! card)
-               return -ENOMEM;
+       error = snd_opti9xx_card_new(&card);
+       if (error < 0)
+               return error;
        chip = card->private_data;
 
        hw = snd_card_opti9xx_pnp(chip, pcard, pid);