ALSA: Convert to snd_card_create() in other sound/*
authorTakashi Iwai <tiwai@alsa3.local>
Sun, 28 Dec 2008 15:45:02 +0000 (16:45 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 12 Jan 2009 14:21:19 +0000 (15:21 +0100)
Convert from snd_card_new() to the new snd_card_create() function
in other sound subdirectories.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
31 files changed:
sound/aoa/core/alsa.c
sound/arm/aaci.c
sound/arm/pxa2xx-ac97.c
sound/arm/sa11xx-uda1341.c
sound/drivers/dummy.c
sound/drivers/ml403-ac97cr.c
sound/drivers/mpu401/mpu401.c
sound/drivers/mtpav.c
sound/drivers/mts64.c
sound/drivers/pcsp/pcsp.c
sound/drivers/portman2x4.c
sound/drivers/serial-u16550.c
sound/drivers/virmidi.c
sound/mips/au1x00.c
sound/mips/hal2.c
sound/mips/sgio2audio.c
sound/parisc/harmony.c
sound/pcmcia/pdaudiocf/pdaudiocf.c
sound/pcmcia/vx/vxpocket.c
sound/ppc/powermac.c
sound/ppc/snd_ps3.c
sound/sh/aica.c
sound/soc/soc-core.c
sound/sparc/amd7930.c
sound/sparc/cs4231.c
sound/sparc/dbri.c
sound/spi/at73c213.c
sound/usb/caiaq/caiaq-device.c
sound/usb/usbaudio.c
sound/usb/usx2y/us122l.c
sound/usb/usx2y/usbusx2y.c

index 617850463582fc682696969659bcda553ec02eb6..0fa3855b4790e30753b7b8ea4fb29644a6e8cd1f 100644 (file)
@@ -23,9 +23,10 @@ int aoa_alsa_init(char *name, struct module *mod, struct device *dev)
                /* cannot be EEXIST due to usage in aoa_fabric_register */
                return -EBUSY;
 
-       alsa_card = snd_card_new(index, name, mod, sizeof(struct aoa_card));
-       if (!alsa_card)
-               return -ENOMEM;
+       err = snd_card_create(index, name, mod, sizeof(struct aoa_card),
+                             &alsa_card);
+       if (err < 0)
+               return err;
        aoa_card = alsa_card->private_data;
        aoa_card->alsa_card = alsa_card;
        alsa_card->dev = dev;
index 89096e811a4bc47dbe1458c2faba375220ec5bbb..7d39aac9ec14eafc88681773a2a2b86f69acf2e4 100644 (file)
@@ -995,10 +995,11 @@ static struct aaci * __devinit aaci_init_card(struct amba_device *dev)
 {
        struct aaci *aaci;
        struct snd_card *card;
+       int err;
 
-       card = snd_card_new(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1,
-                           THIS_MODULE, sizeof(struct aaci));
-       if (card == NULL)
+       err = snd_card_create(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1,
+                             THIS_MODULE, sizeof(struct aaci), &card);
+       if (err < 0)
                return NULL;
 
        card->private_free = aaci_free_card;
index 85cf591d4e11d594d96ac970ec1bed41d473bbb2..7ed100c80a5f752a7768cc11d152eb1e01471a8c 100644 (file)
@@ -173,10 +173,9 @@ static int __devinit pxa2xx_ac97_probe(struct platform_device *dev)
        struct snd_ac97_template ac97_template;
        int ret;
 
-       ret = -ENOMEM;
-       card = snd_card_new(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1,
-                           THIS_MODULE, 0);
-       if (!card)
+       ret = snd_card_create(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1,
+                             THIS_MODULE, 0, &card);
+       if (ret < 0)
                goto err;
 
        card->dev = &dev->dev;
index 1dcd51d81d102c1adcd5ea5282933b9ba9f947f5..51d708c31e6586a50414a8ceec47cdec8794f0f4 100644 (file)
@@ -887,9 +887,10 @@ static int __devinit sa11xx_uda1341_probe(struct platform_device *devptr)
        struct sa11xx_uda1341 *chip;
 
        /* register the soundcard */
-       card = snd_card_new(-1, id, THIS_MODULE, sizeof(struct sa11xx_uda1341));
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(-1, id, THIS_MODULE,
+                             sizeof(struct sa11xx_uda1341), &card);
+       if (err < 0)
+               return err;
 
        chip = card->private_data;
        spin_lock_init(&chip->s[0].dma_lock);
index 73be7e14a603d56208aec9d9bd741b48c5444750..54239d2e0997b7ac88e2e6c2e3898afc79a7c0f9 100644 (file)
@@ -588,10 +588,10 @@ static int __devinit snd_dummy_probe(struct platform_device *devptr)
        int idx, err;
        int dev = devptr->id;
 
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE,
-                           sizeof(struct snd_dummy));
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE,
+                             sizeof(struct snd_dummy), &card);
+       if (err < 0)
+               return err;
        dummy = card->private_data;
        dummy->card = card;
        for (idx = 0; idx < MAX_PCM_DEVICES && idx < pcm_devs[dev]; idx++) {
index 7783843ca9ae95ce9dd2acee69eb970acd914348..1950ffce2b545cdff262daae280128134259fa20 100644 (file)
@@ -1279,9 +1279,9 @@ static int __devinit snd_ml403_ac97cr_probe(struct platform_device *pfdev)
        if (!enable[dev])
                return -ENOENT;
 
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
        err = snd_ml403_ac97cr_create(card, pfdev, &ml403_ac97cr);
        if (err < 0) {
                PDEBUG(INIT_FAILURE, "probe(): create failed!\n");
index 5b996f3faba5844c434d693af77fee3bcd3bbba4..149d05a8202d58bf381c3eb059e3302f89e2a188 100644 (file)
@@ -73,9 +73,9 @@ static int snd_mpu401_create(int dev, struct snd_card **rcard)
                snd_printk(KERN_ERR "the uart_enter option is obsolete; remove it\n");
 
        *rcard = NULL;
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
        strcpy(card->driver, "MPU-401 UART");
        strcpy(card->shortname, card->driver);
        sprintf(card->longname, "%s at %#lx, ", card->shortname, port[dev]);
index 5b89c0883d6081b8d5b8b854d72585ef345f6c55..c3e9833dcfd9af1ffc2d8c53e49a6894a9ed1ef3 100644 (file)
@@ -696,9 +696,9 @@ static int __devinit snd_mtpav_probe(struct platform_device *dev)
        int err;
        struct mtpav *mtp_card;
 
-       card = snd_card_new(index, id, THIS_MODULE, sizeof(*mtp_card));
-       if (! card)
-               return -ENOMEM;
+       err = snd_card_create(index, id, THIS_MODULE, sizeof(*mtp_card), &card);
+       if (err < 0)
+               return err;
 
        mtp_card = card->private_data;
        spin_lock_init(&mtp_card->spinlock);
index 87ba1ddc01151fdfb5bd8f38d80103a68964aa5a..33d9db782e07e4d85ac62c9c89a4ee485a894056 100644 (file)
@@ -957,10 +957,10 @@ static int __devinit snd_mts64_probe(struct platform_device *pdev)
        if ((err = snd_mts64_probe_port(p)) < 0)
                return err;
 
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
-       if (card == NULL) {
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       if (err < 0) {
                snd_printd("Cannot create card\n");
-               return -ENOMEM;
+               return err;
        }
        strcpy(card->driver, DRIVER_NAME);
        strcpy(card->shortname, "ESI " CARD_NAME);
index a4049eb94d35a28bafa41072e6e44af726d6f251..aa2ae07a76d563fb5e8d64fdec7606570a0ed569 100644 (file)
@@ -98,9 +98,9 @@ static int __devinit snd_card_pcsp_probe(int devnum, struct device *dev)
        hrtimer_init(&pcsp_chip.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
        pcsp_chip.timer.function = pcsp_do_timer;
 
-       card = snd_card_new(index, id, THIS_MODULE, 0);
-       if (!card)
-               return -ENOMEM;
+       err = snd_card_create(index, id, THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
 
        err = snd_pcsp_create(card);
        if (err < 0) {
index b1c047ec19afe6e5ce9e6cf1acb2124c72719d45..60158e2e0eafb529e00013b4a9997d325b1b7fa2 100644 (file)
@@ -746,10 +746,10 @@ static int __devinit snd_portman_probe(struct platform_device *pdev)
        if ((err = snd_portman_probe_port(p)) < 0)
                return err;
 
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
-       if (card == NULL) {
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       if (err < 0) {
                snd_printd("Cannot create card\n");
-               return -ENOMEM;
+               return err;
        }
        strcpy(card->driver, DRIVER_NAME);
        strcpy(card->shortname, CARD_NAME);
index d8aab9da97c29ad8058f5be9751537b25b043500..891d081e4825d780f3ce78e3622477bf2e24060d 100644 (file)
@@ -936,9 +936,9 @@ static int __devinit snd_serial_probe(struct platform_device *devptr)
                return -ENODEV;
        }
 
-       card  = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
-       if (card == NULL)
-               return -ENOMEM;
+       err  = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
 
        strcpy(card->driver, "Serial");
        strcpy(card->shortname, "Serial MIDI (UART16550A)");
index f79e3614079d238aca26df870c863949bbda1e94..6f48711818f33eff1ea78d7ec5cca29b6e6dd835 100644 (file)
@@ -90,10 +90,10 @@ static int __devinit snd_virmidi_probe(struct platform_device *devptr)
        int idx, err;
        int dev = devptr->id;
 
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE,
-                           sizeof(struct snd_card_virmidi));
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE,
+                             sizeof(struct snd_card_virmidi), &card);
+       if (err < 0)
+               return err;
        vmidi = (struct snd_card_virmidi *)card->private_data;
        vmidi->card = card;
 
index 1881cec11e78d221b55f4132219ec48c0cc9c147..99e1391b2eb42ffce2d7425621afa0c26134e770 100644 (file)
@@ -636,9 +636,10 @@ au1000_init(void)
        struct snd_card *card;
        struct snd_au1000 *au1000;
 
-       card = snd_card_new(-1, "AC97", THIS_MODULE, sizeof(struct snd_au1000));
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(-1, "AC97", THIS_MODULE,
+                             sizeof(struct snd_au1000), &card);
+       if (err < 0)
+               return err;
 
        card->private_free = snd_au1000_free;
        au1000 = card->private_data;
index db495be01861ffee559d34221ff82a8624214502..c52691c2fc46df746aee9136545f1c4ed6aa1447 100644 (file)
@@ -878,9 +878,9 @@ static int __devinit hal2_probe(struct platform_device *pdev)
        struct snd_hal2 *chip;
        int err;
 
-       card = snd_card_new(index, id, THIS_MODULE, 0);
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index, id, THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
 
        err = hal2_create(card, &chip);
        if (err < 0) {
index 4c63504348dc4ba155cfd8ab79a4e03347db8d84..66f3b48ceafcdcbedb7e4700a4ae8a341283cd3f 100644 (file)
@@ -936,9 +936,9 @@ static int __devinit snd_sgio2audio_probe(struct platform_device *pdev)
        struct snd_sgio2audio *chip;
        int err;
 
-       card = snd_card_new(index, id, THIS_MODULE, 0);
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index, id, THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
 
        err = snd_sgio2audio_create(card, &chip);
        if (err < 0) {
index 41f870f8a11d21390e1caa473326d659274e28fc..6055fd6d3b38ee90ba6d19895363ef33db38f275 100644 (file)
@@ -975,9 +975,9 @@ snd_harmony_probe(struct parisc_device *padev)
        struct snd_card *card;
        struct snd_harmony *h;
 
-       card = snd_card_new(index, id, THIS_MODULE, 0);
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index, id, THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
 
        err = snd_harmony_create(card, padev, &h);
        if (err < 0)
index 819aaaac432f839e5667b986142f6da609416d57..183f6615c68c903c8fdeae5e0595f3c21a354c3a 100644 (file)
@@ -91,7 +91,7 @@ static int snd_pdacf_dev_free(struct snd_device *device)
  */
 static int snd_pdacf_probe(struct pcmcia_device *link)
 {
-       int i;
+       int i, err;
        struct snd_pdacf *pdacf;
        struct snd_card *card;
        static struct snd_device_ops ops = {
@@ -112,10 +112,10 @@ static int snd_pdacf_probe(struct pcmcia_device *link)
                return -ENODEV; /* disabled explicitly */
 
        /* ok, create a card instance */
-       card = snd_card_new(index[i], id[i], THIS_MODULE, 0);
-       if (card == NULL) {
+       err = snd_card_create(index[i], id[i], THIS_MODULE, 0, &card);
+       if (err < 0) {
                snd_printk(KERN_ERR "pdacf: cannot create a card instance\n");
-               return -ENOMEM;
+               return err;
        }
 
        pdacf = snd_pdacf_create(card);
index 706602a40600718666c3a5e5fb7e957dc901e622..087ded8a8d72238c76c568a2a881cc7b8002fcf6 100644 (file)
@@ -292,7 +292,7 @@ static int vxpocket_probe(struct pcmcia_device *p_dev)
 {
        struct snd_card *card;
        struct snd_vxpocket *vxp;
-       int i;
+       int i, err;
 
        /* find an empty slot from the card list */
        for (i = 0; i < SNDRV_CARDS; i++) {
@@ -307,10 +307,10 @@ static int vxpocket_probe(struct pcmcia_device *p_dev)
                return -ENODEV; /* disabled explicitly */
 
        /* ok, create a card instance */
-       card = snd_card_new(index[i], id[i], THIS_MODULE, 0);
-       if (card == NULL) {
+       err = snd_card_create(index[i], id[i], THIS_MODULE, 0, &card);
+       if (err < 0) {
                snd_printk(KERN_ERR "vxpocket: cannot create a card instance\n");
-               return -ENOMEM;
+               return err;
        }
 
        vxp = snd_vxpocket_new(card, ibl[i], p_dev);
index c936225771ba0cd8381686c3c6b7424f288b051a..2e18ed0ea899f893e04c939d891b5010759e4afc 100644 (file)
@@ -58,9 +58,9 @@ static int __init snd_pmac_probe(struct platform_device *devptr)
        char *name_ext;
        int err;
 
-       card = snd_card_new(index, id, THIS_MODULE, 0);
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index, id, THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
 
        if ((err = snd_pmac_new(card, &chip)) < 0)
                goto __error;
index 8f9e3859c37ca70f802fdb5c3f8f25ed75731b8d..ef2c3f417175aaec7b2cd656e43866f28f9289db 100644 (file)
@@ -969,11 +969,9 @@ static int __init snd_ps3_driver_probe(struct ps3_system_bus_device *dev)
        }
 
        /* create card instance */
-       the_card.card = snd_card_new(index, id, THIS_MODULE, 0);
-       if (!the_card.card) {
-               ret = -ENXIO;
+       ret = snd_card_create(index, id, THIS_MODULE, 0, &the_card.card);
+       if (ret < 0)
                goto clean_irq;
-       }
 
        strcpy(the_card.card->driver, "PS3");
        strcpy(the_card.card->shortname, "PS3");
index 7c920f3e7fe35e4a917597d92b736011e8a62ba4..f551233c5a08d6958c14caebe24a1e227257e829 100644 (file)
@@ -609,11 +609,11 @@ static int __devinit snd_aica_probe(struct platform_device *devptr)
        dreamcastcard = kmalloc(sizeof(struct snd_card_aica), GFP_KERNEL);
        if (unlikely(!dreamcastcard))
                return -ENOMEM;
-       dreamcastcard->card =
-           snd_card_new(index, SND_AICA_DRIVER, THIS_MODULE, 0);
-       if (unlikely(!dreamcastcard->card)) {
+       err = snd_card_create(index, SND_AICA_DRIVER, THIS_MODULE, 0,
+                             &dreamcastcard->card);
+       if (unlikely(err < 0)) {
                kfree(dreamcastcard);
-               return -ENODEV;
+               return err;
        }
        strcpy(dreamcastcard->card->driver, "snd_aica");
        strcpy(dreamcastcard->card->shortname, SND_AICA_DRIVER);
index 6cbe7e82f2385f1a405372412b4b2ff1f6db7ef5..318dfdd54d7f00065002d1d834e382bd827dea07 100644 (file)
@@ -1311,17 +1311,17 @@ int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid)
 {
        struct snd_soc_codec *codec = socdev->codec;
        struct snd_soc_card *card = socdev->card;
-       int ret = 0, i;
+       int ret, i;
 
        mutex_lock(&codec->mutex);
 
        /* register a sound card */
-       codec->card = snd_card_new(idx, xid, codec->owner, 0);
-       if (!codec->card) {
+       ret = snd_card_create(idx, xid, codec->owner, 0, &codec->card);
+       if (ret < 0) {
                printk(KERN_ERR "asoc: can't create sound card for codec %s\n",
                        codec->name);
                mutex_unlock(&codec->mutex);
-               return -ENODEV;
+               return ret;
        }
 
        codec->card->dev = socdev->dev;
index f87933e48812d8c7aba976d64fd9477912c85e41..ba38912614b4f90fca9444611ddb2fa1944e87bc 100644 (file)
@@ -1018,9 +1018,10 @@ static int __devinit amd7930_sbus_probe(struct of_device *op, const struct of_de
                return -ENOENT;
        }
 
-       card = snd_card_new(index[dev_num], id[dev_num], THIS_MODULE, 0);
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index[dev_num], id[dev_num], THIS_MODULE, 0,
+                             &card);
+       if (err < 0)
+               return err;
 
        strcpy(card->driver, "AMD7930");
        strcpy(card->shortname, "Sun AMD7930");
index 41c387587474c9ccaef6ae1c228ad1dffde14977..7d93fa705ccf493135b36cefff7ea242812ca11b 100644 (file)
@@ -1563,6 +1563,7 @@ static int __init cs4231_attach_begin(struct snd_card **rcard)
 {
        struct snd_card *card;
        struct snd_cs4231 *chip;
+       int err;
 
        *rcard = NULL;
 
@@ -1574,10 +1575,10 @@ static int __init cs4231_attach_begin(struct snd_card **rcard)
                return -ENOENT;
        }
 
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE,
-                           sizeof(struct snd_cs4231));
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE,
+                             sizeof(struct snd_cs4231), &card);
+       if (err < 0)
+               return err;
 
        strcpy(card->driver, "CS4231");
        strcpy(card->shortname, "Sun CS4231");
index 23ed6f04a718c30d30db22e577974c4ee54f8190..af95ff1e126cc39a83d0e833fb0d126c334e6278 100644 (file)
@@ -2612,10 +2612,10 @@ static int __devinit dbri_probe(struct of_device *op, const struct of_device_id
                return -ENODEV;
        }
 
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE,
-                           sizeof(struct snd_dbri));
-       if (card == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE,
+                             sizeof(struct snd_dbri), &card);
+       if (err < 0)
+               return err;
 
        strcpy(card->driver, "DBRI");
        strcpy(card->shortname, "Sun DBRI");
index 09802e8a6fb834419f8c752ac8edb7c68405de88..4c7b051f9d17705bfc9827113e4fc8f74792e7c7 100644 (file)
@@ -965,12 +965,11 @@ static int __devinit snd_at73c213_probe(struct spi_device *spi)
                return PTR_ERR(board->dac_clk);
        }
 
-       retval = -ENOMEM;
-
        /* Allocate "card" using some unused identifiers. */
        snprintf(id, sizeof id, "at73c213_%d", board->ssc_id);
-       card = snd_card_new(-1, id, THIS_MODULE, sizeof(struct snd_at73c213));
-       if (!card)
+       retval = snd_card_create(-1, id, THIS_MODULE,
+                                sizeof(struct snd_at73c213), &card);
+       if (retval < 0)
                goto out;
 
        chip = card->private_data;
index a62500e387a654b904a2cdfda9c6b16f319bfa1b..63a2c1d5779b01cac88cac0e4b7ba679c6759866 100644 (file)
@@ -339,6 +339,7 @@ static void __devinit setup_card(struct snd_usb_caiaqdev *dev)
 static struct snd_card* create_card(struct usb_device* usb_dev)
 {
        int devnum;
+       int err;
        struct snd_card *card;
        struct snd_usb_caiaqdev *dev;
 
@@ -349,9 +350,9 @@ static struct snd_card* create_card(struct usb_device* usb_dev)
        if (devnum >= SNDRV_CARDS)
                return NULL;
 
-       card = snd_card_new(index[devnum], id[devnum], THIS_MODULE, 
-                                       sizeof(struct snd_usb_caiaqdev));
-       if (!card)
+       err = snd_card_create(index[devnum], id[devnum], THIS_MODULE, 
+                             sizeof(struct snd_usb_caiaqdev), &card);
+       if (err < 0)
                return NULL;
 
        dev = caiaqdev(card);
index c709b9563226c0b343f98588f4bc91345c5bf185..eec32e1a3020ccfe23798e005e0a97a636676b2b 100644 (file)
@@ -3463,10 +3463,10 @@ static int snd_usb_audio_create(struct usb_device *dev, int idx,
                return -ENXIO;
        }
 
-       card = snd_card_new(index[idx], id[idx], THIS_MODULE, 0);
-       if (card == NULL) {
+       err = snd_card_create(index[idx], id[idx], THIS_MODULE, 0, &card);
+       if (err < 0) {
                snd_printk(KERN_ERR "cannot create card instance %d\n", idx);
-               return -ENOMEM;
+               return err;
        }
 
        chip = kzalloc(sizeof(*chip), GFP_KERNEL);
index 73e59f4403a483b16a041a9bba9f767e6b021c60..b21bb475c0ffd7a4b46bc55f1732fa0d58ac220f 100644 (file)
@@ -482,14 +482,16 @@ static struct snd_card *usx2y_create_card(struct usb_device *device)
 {
        int             dev;
        struct snd_card *card;
+       int err;
+
        for (dev = 0; dev < SNDRV_CARDS; ++dev)
                if (enable[dev] && !snd_us122l_card_used[dev])
                        break;
        if (dev >= SNDRV_CARDS)
                return NULL;
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE,
-                           sizeof(struct us122l));
-       if (!card)
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE,
+                             sizeof(struct us122l), &card);
+       if (err < 0)
                return NULL;
        snd_us122l_card_used[US122L(card)->chip.index = dev] = 1;
 
index 11639bd72a518fe340f54236ccecf6c2667f7f67..b848a180638529fdb63175ba470a188f1532808b 100644 (file)
@@ -337,13 +337,16 @@ static struct snd_card *usX2Y_create_card(struct usb_device *device)
 {
        int             dev;
        struct snd_card *       card;
+       int err;
+
        for (dev = 0; dev < SNDRV_CARDS; ++dev)
                if (enable[dev] && !snd_usX2Y_card_used[dev])
                        break;
        if (dev >= SNDRV_CARDS)
                return NULL;
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(struct usX2Ydev));
-       if (!card)
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE,
+                             sizeof(struct usX2Ydev), &card);
+       if (err < 0)
                return NULL;
        snd_usX2Y_card_used[usX2Y(card)->chip.index = dev] = 1;
        card->private_free = snd_usX2Y_card_private_free;