]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ALSA: Convert to snd_card_create() in sound/pci/*
authorTakashi Iwai <tiwai@alsa3.local>
Sun, 28 Dec 2008 15:44:30 +0000 (16:44 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 12 Jan 2009 14:20:55 +0000 (15:20 +0100)
Convert from snd_card_new() to the new snd_card_create() function
in sound/pci/*.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
47 files changed:
sound/pci/ad1889.c
sound/pci/ali5451/ali5451.c
sound/pci/als300.c
sound/pci/als4000.c
sound/pci/atiixp.c
sound/pci/atiixp_modem.c
sound/pci/au88x0/au88x0.c
sound/pci/aw2/aw2-alsa.c
sound/pci/azt3328.c
sound/pci/bt87x.c
sound/pci/ca0106/ca0106_main.c
sound/pci/cmipci.c
sound/pci/cs4281.c
sound/pci/cs46xx/cs46xx.c
sound/pci/cs5530.c
sound/pci/cs5535audio/cs5535audio.c
sound/pci/echoaudio/echoaudio.c
sound/pci/emu10k1/emu10k1.c
sound/pci/emu10k1/emu10k1x.c
sound/pci/ens1370.c
sound/pci/es1938.c
sound/pci/es1968.c
sound/pci/fm801.c
sound/pci/hda/hda_intel.c
sound/pci/ice1712/ice1712.c
sound/pci/ice1712/ice1724.c
sound/pci/intel8x0.c
sound/pci/intel8x0m.c
sound/pci/korg1212/korg1212.c
sound/pci/maestro3.c
sound/pci/mixart/mixart.c
sound/pci/nm256/nm256.c
sound/pci/oxygen/oxygen_lib.c
sound/pci/pcxhr/pcxhr.c
sound/pci/riptide/riptide.c
sound/pci/rme32.c
sound/pci/rme96.c
sound/pci/rme9652/hdsp.c
sound/pci/rme9652/hdspm.c
sound/pci/rme9652/rme9652.c
sound/pci/sis7019.c
sound/pci/sonicvibes.c
sound/pci/trident/trident.c
sound/pci/via82xx.c
sound/pci/via82xx_modem.c
sound/pci/vx222/vx222.c
sound/pci/ymfpci/ymfpci.c

index a7f38e63303f82120ceffacb4f08daf4b75f889d..d1f242bd0ac544584ad9c7f4349261c7c7f37588 100644 (file)
@@ -995,10 +995,10 @@ snd_ad1889_probe(struct pci_dev *pci,
        }
 
        /* (2) */
-       card = snd_card_new(index[devno], id[devno], THIS_MODULE, 0);
+       err = snd_card_create(index[devno], id[devno], THIS_MODULE, 0, &card);
        /* XXX REVISIT: we can probably allocate chip in this call */
-       if (card == NULL)
-               return -ENOMEM;
+       if (err < 0)
+               return err;
 
        strcpy(card->driver, "AD1889");
        strcpy(card->shortname, "Analog Devices AD1889");
index 1a0fd65ec2809478d71f037f310f6a3f36a1823b..b36c551da566de2b73386727487c669c72360eda 100644 (file)
@@ -2307,9 +2307,9 @@ static int __devinit snd_ali_probe(struct pci_dev *pci,
 
        snd_ali_printk("probe ...\n");
 
-       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_ali_create(card, pci, pcm_channels, spdif, &codec);
        if (err < 0)
index 8df6824b51cda258d2627d6eb30cbba1824e50b8..f557c155db482da8e83d163bd6059d9930621ad4 100644 (file)
@@ -812,10 +812,10 @@ static int __devinit snd_als300_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
 
-       if (card == NULL)
-               return -ENOMEM;
+       if (err < 0)
+               return err;
 
        chip_type = pci_id->driver_data;
 
index ba570053d4d538c74b0c5f8b127ba41c2759acd8..542a0c65a92c52cc39fa3371020eb6dae5cb7940 100644 (file)
@@ -889,12 +889,13 @@ static int __devinit snd_card_als4000_probe(struct pci_dev *pci,
        pci_write_config_word(pci, PCI_COMMAND, word | PCI_COMMAND_IO);
        pci_set_master(pci);
        
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 
-                           sizeof(*acard) /* private_data: acard */);
-       if (card == NULL) {
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 
+                             sizeof(*acard) /* private_data: acard */,
+                             &card);
+       if (err < 0) {
                pci_release_regions(pci);
                pci_disable_device(pci);
-               return -ENOMEM;
+               return err;
        }
 
        acard = card->private_data;
index 226fe8237d31997c445f0337b4effca37f57bf37..9ce8548c03e459a381b1fb2c6fb6fb9706b9480b 100644 (file)
@@ -1645,9 +1645,9 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
        struct atiixp *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;
 
        strcpy(card->driver, spdif_aclink ? "ATIIXP" : "ATIIXP-SPDMA");
        strcpy(card->shortname, "ATI IXP");
index 0e6e5cc1c501e36f531baf07c23d31089f4d931a..c3136cccc559e86f90f978d9bb922ae305c5d140 100644 (file)
@@ -1288,9 +1288,9 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
        struct atiixp_modem *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;
 
        strcpy(card->driver, "ATIIXP-MODEM");
        strcpy(card->shortname, "ATI IXP Modem");
index a36d4d1fd419f098e3dabdfa598914d49d92b378..9ec122383eefbab4492fe9d180e6737f7b4f9ed0 100644 (file)
@@ -250,9 +250,9 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
                return -ENOENT;
        }
        // (2)
-       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;
 
        // (3)
        if ((err = snd_vortex_create(card, pci, &chip)) < 0) {
index 3f00ddf450f81c287b198cdbdf4c8a17b180c4f8..eefcbf648ee1d95e4d80dae4c4043f75f2aa8fd7 100644 (file)
@@ -368,9 +368,9 @@ static int __devinit snd_aw2_probe(struct pci_dev *pci,
        }
 
        /* (2) Create card instance */
-       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;
 
        /* (3) Create main component */
        err = snd_aw2_create(card, pci, &chip);
index 333007c523a1f876b2deca492a71c59f93de86e4..1df96e76c4832146eec9110be12f4fbe54b8099a 100644 (file)
@@ -2216,9 +2216,9 @@ snd_azf3328_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
                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;
 
        strcpy(card->driver, "AZF3328");
        strcpy(card->shortname, "Aztech AZF3328 (PCI168)");
index 1aa1c04025407f2243d11a277f26b2a29da6c740..a299340519dfab53f07e3991124ca18223753c32 100644 (file)
@@ -888,9 +888,9 @@ static int __devinit snd_bt87x_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
-       if (!card)
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
 
        err = snd_bt87x_create(card, pci, &chip);
        if (err < 0)
index 0e62205d4081d3da96606c9b48f7b568d221f7ca..b116456e77071ea75ba27e995c98ca4adb933ca8 100644 (file)
@@ -1707,9 +1707,9 @@ static int __devinit snd_ca0106_probe(struct pci_dev *pci,
                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_ca0106_create(dev, card, pci, &chip);
        if (err < 0)
index 1a74ca62c31484a8b8923f324771c43fcd1491a3..c7899c32aba19d08b945da3e4c4e510d46fa6a8f 100644 (file)
@@ -3272,9 +3272,9 @@ static int __devinit snd_cmipci_probe(struct pci_dev *pci,
                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;
        
        switch (pci->device) {
        case PCI_DEVICE_ID_CMEDIA_CM8738:
index 192e7842e181e4cbbe8c3f0be43c7cccb4213964..b9b07f464631ec84da04ebdac6c3a8c19806c10a 100644 (file)
@@ -1925,9 +1925,9 @@ static int __devinit snd_cs4281_probe(struct pci_dev *pci,
                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;
 
        if ((err = snd_cs4281_create(card, pci, &chip, dual_codec[dev])) < 0) {
                snd_card_free(card);
index e876b3263e462a9060b071e7974f1b0dcb90c583..c9b3e3d48cbcbf819e16e5d0a8535e8029310596 100644 (file)
@@ -88,9 +88,9 @@ static int __devinit snd_card_cs46xx_probe(struct pci_dev *pci,
                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;
        if ((err = snd_cs46xx_create(card, pci,
                                     external_amp[dev], thinkpad[dev],
                                     &chip)) < 0) {
index 6dea5b5cc77419814334addf8b22c06c5bee142c..dc464321d0f3ebda294e8e45de1db429122f4bc7 100644 (file)
@@ -258,10 +258,10 @@ static int __devinit snd_cs5530_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
 
-       if (card == NULL)
-               return -ENOMEM;
+       if (err < 0)
+               return err;
 
        err = snd_cs5530_create(card, pci, &chip);
        if (err < 0) {
index 826e6dec2e97cf1e834d08b4c380469cb4717c8a..ac1d72e0a1e4ba1233f1cc2e479e1b0eeae5456f 100644 (file)
@@ -353,9 +353,9 @@ static int __devinit snd_cs5535audio_probe(struct pci_dev *pci,
                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;
 
        if ((err = snd_cs5535audio_create(card, pci, &cs5535au)) < 0)
                goto probefail_out;
index 8dbc5c4ba421a03dd128050dbd271616efdee3ae..9d015a76eb691c6ed8cba64e58b6d3b8f810d4b8 100644 (file)
@@ -1997,9 +1997,9 @@ static int __devinit snd_echo_probe(struct pci_dev *pci,
 
        DE_INIT(("Echoaudio driver starting...\n"));
        i = 0;
-       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;
 
        snd_card_set_dev(card, &pci->dev);
 
index 8354c1a833129c7300b765ef918462a3852537f6..c7f3b994101cef1f335fde62e09a5d53616e4152 100644 (file)
@@ -114,9 +114,9 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci,
                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;
        if (max_buffer_size[dev] < 32)
                max_buffer_size[dev] = 32;
        else if (max_buffer_size[dev] > 1024)
index 5ff4dbb62dad1412e3f7ca987052427086912944..31542adc6b7e34a34d2ef6dca5758cb1992ad8af 100644 (file)
@@ -1544,9 +1544,9 @@ static int __devinit snd_emu10k1x_probe(struct pci_dev *pci,
                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;
 
        if ((err = snd_emu10k1x_create(card, pci, &chip)) < 0) {
                snd_card_free(card);
index 9bf95367c882b4fbe80558f254aa2b45456f9646..e00614cbceffbec319dbaf6b3ab39829c4d391ed 100644 (file)
@@ -2409,9 +2409,9 @@ static int __devinit snd_audiopci_probe(struct pci_dev *pci,
                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;
 
        if ((err = snd_ensoniq_create(card, pci, &ensoniq)) < 0) {
                snd_card_free(card);
index 4cd9a1faaecc186732b1ad911ebfd74e3c59e77e..34a78afc26d0b33666c7b6cc6c9a3a65fe4a8ec2 100644 (file)
@@ -1799,9 +1799,9 @@ static int __devinit snd_es1938_probe(struct pci_dev *pci,
                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;
        for (idx = 0; idx < 5; idx++) {
                if (pci_resource_start(pci, idx) == 0 ||
                    !(pci_resource_flags(pci, idx) & IORESOURCE_IO)) {
index e9c3794bbcb8a409751cc26ab466764d37fd1698..dc97e8116141645d9d399cf8eee503979c267784 100644 (file)
@@ -2645,9 +2645,9 @@ static int __devinit snd_es1968_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
-       if (!card)
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       if (err < 0)
+               return err;
                 
        if (total_bufsize[dev] < 128)
                total_bufsize[dev] = 128;
index c129f9e2072cb6970a1d5e83ad7b7f3950a4160b..60cdb9e0b68d23d112745c3dbe73354c124c1137 100644 (file)
@@ -1468,9 +1468,9 @@ static int __devinit snd_card_fm801_probe(struct pci_dev *pci,
                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;
        if ((err = snd_fm801_create(card, pci, tea575x_tuner[dev], &chip)) < 0) {
                snd_card_free(card);
                return err;
index f04de115ee11eed00fa45304414444c1715ed1be..ad5df2ae6f7d6d638611e7cbf8d60af1105e1e60 100644 (file)
@@ -2335,10 +2335,10 @@ static int __devinit azx_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
-       if (!card) {
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       if (err < 0) {
                snd_printk(KERN_ERR SFX "Error creating card!\n");
-               return -ENOMEM;
+               return err;
        }
 
        err = azx_create(card, pci, dev, pci_id->driver_data, &chip);
index 58d7cda03de5827f44b58ab435c602460c909b0f..bab1c700f4976c5e32891f9291cea69e84a50903 100644 (file)
@@ -2648,9 +2648,9 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
                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;
 
        strcpy(card->driver, "ICE1712");
        strcpy(card->shortname, "ICEnsemble ICE1712");
index bb8d8c766b9d1f5ee5e08f85a8a36694ac1b8058..7ff36d3f0f44f9078da5f08e8be89e8a32b0a485 100644 (file)
@@ -2456,9 +2456,9 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci,
                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;
 
        strcpy(card->driver, "ICE1724");
        strcpy(card->shortname, "ICEnsemble ICE1724");
index 19d3391e229f2f7e02615a12344142464dfcb902..671ff65db0298974494d7ca6e362c7a7559dc57e 100644 (file)
@@ -3058,9 +3058,9 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
        int err;
        struct shortname_table *name;
 
-       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 (spdif_aclink < 0)
                spdif_aclink = check_default_spdif_aclink(pci);
index 93449e464566c019a5a0a3c11677bd8b2654fc56..33a843c193165ddbe7b0aa7b723784b46d2b6cf5 100644 (file)
@@ -1269,9 +1269,9 @@ static int __devinit snd_intel8x0m_probe(struct pci_dev *pci,
        int err;
        struct shortname_table *name;
 
-       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;
 
        strcpy(card->driver, "ICH-MODEM");
        strcpy(card->shortname, "Intel ICH");
index 5f8006b4275019ddd475e55e0ea7c8238b514b47..8b79969034be24853b57afda72a88566ed316d10 100644 (file)
@@ -2443,9 +2443,9 @@ snd_korg1212_probe(struct pci_dev *pci,
                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;
 
         if ((err = snd_korg1212_create(card, pci, &korg1212)) < 0) {
                snd_card_free(card);
index 59bbaf8f3e5b9bbe026fe13162e5258408598958..70141548f251236879c6d23765c318648cabca56 100644 (file)
@@ -2691,9 +2691,9 @@ snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
                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;
 
        switch (pci->device) {
        case PCI_DEVICE_ID_ESS_ALLEGRO:
index f23a73577c2219cb7da2b03317bf1106b7e1f981..bfc19e36c4b698ac3798c91b2567512984b3148e 100644 (file)
@@ -1365,12 +1365,12 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
                else
                        idx = index[dev] + i;
                snprintf(tmpid, sizeof(tmpid), "%s-%d", id[dev] ? id[dev] : "MIXART", i);
-               card = snd_card_new(idx, tmpid, THIS_MODULE, 0);
+               err = snd_card_create(idx, tmpid, THIS_MODULE, 0, &card);
 
-               if (! card) {
+               if (err < 0) {
                        snd_printk(KERN_ERR "cannot allocate the card %d\n", i);
                        snd_mixart_free(mgr);
-                       return -ENOMEM;
+                       return err;
                }
 
                strcpy(card->driver, CARD_NAME);
index 50c9f8a05082fa6c5aa67919203d80e030895b18..522a040855d41e7321414cfbd2b5c3e22b0d47a8 100644 (file)
@@ -1668,9 +1668,9 @@ static int __devinit snd_nm256_probe(struct pci_dev *pci,
                }
        }
 
-       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;
 
        switch (pci->device) {
        case PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO:
index 84f481d41efa5910eeda20b0b8840556d6fd6183..9c81e0b051130037bc3dff42de4b05cc7e535815 100644 (file)
@@ -459,10 +459,10 @@ int oxygen_pci_probe(struct pci_dev *pci, int index, char *id,
        struct oxygen *chip;
        int err;
 
-       card = snd_card_new(index, id, model->owner,
-                           sizeof *chip + model->model_data_size);
-       if (!card)
-               return -ENOMEM;
+       err = snd_card_create(index, id, model->owner,
+                             sizeof(*chip) + model->model_data_size, &card);
+       if (err < 0)
+               return err;
 
        chip = card->private_data;
        chip->card = card;
index 27cf2c28d1131eac14cf96ac3b55eb34c51ec543..7f95459c8b1f4e149a1acc7f54c9adb21acf6e39 100644 (file)
@@ -1510,12 +1510,12 @@ static int __devinit pcxhr_probe(struct pci_dev *pci,
 
                snprintf(tmpid, sizeof(tmpid), "%s-%d",
                         id[dev] ? id[dev] : card_name, i);
-               card = snd_card_new(idx, tmpid, THIS_MODULE, 0);
+               err = snd_card_create(idx, tmpid, THIS_MODULE, 0, &card);
 
-               if (! card) {
+               if (err < 0) {
                        snd_printk(KERN_ERR "cannot allocate the card %d\n", i);
                        pcxhr_free(mgr);
-                       return -ENOMEM;
+                       return err;
                }
 
                strcpy(card->driver, DRIVER_NAME);
index 3caacfb9d8e005c3382b76ef8a742b798837a77d..6f1034417a0209e6532ba33197f4490583a8ec6b 100644 (file)
@@ -2102,9 +2102,9 @@ snd_card_riptide_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
                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;
        if ((err = snd_riptide_create(card, pci, &chip)) < 0) {
                snd_card_free(card);
                return err;
index e7ef3a1a25a89a4643b85c888435f22cb28c34a1..d7b966e7c4cf69270358a6070979e904e072f3d4 100644 (file)
@@ -1941,9 +1941,10 @@ snd_rme32_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
                return -ENOENT;
        }
 
-       if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE,
-                                sizeof(struct rme32))) == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE,
+                             sizeof(struct rme32), &card);
+       if (err < 0)
+               return err;
        card->private_free = snd_rme32_card_free;
        rme32 = (struct rme32 *) card->private_data;
        rme32->card = card;
index 3fdd488d09759afca5389383c76590e57bb4dc63..55fb1c131f5809a1b2b62383c99c3ac6037e90c8 100644 (file)
@@ -2348,9 +2348,10 @@ snd_rme96_probe(struct pci_dev *pci,
                dev++;
                return -ENOENT;
        }
-       if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE,
-                                sizeof(struct rme96))) == NULL)
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE,
+                             sizeof(struct rme96), &card);
+       if (err < 0)
+               return err;
        card->private_free = snd_rme96_card_free;
        rme96 = (struct rme96 *)card->private_data;     
        rme96->card = card;
index 44d0c15e2b71a150cf2643194a978e6c6fa7ee95..05b3f795a1680167a3d09c3666fc3ea7c8272d82 100644 (file)
@@ -5158,8 +5158,10 @@ static int __devinit snd_hdsp_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       if (!(card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(struct hdsp))))
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE,
+                             sizeof(struct hdsp), &card);
+       if (err < 0)
+               return err;
 
        hdsp = (struct hdsp *) card->private_data;
        card->private_free = snd_hdsp_card_free;
index 71231cf1b2b0ac2c335236d40ba4a5f99543d47b..d4b4e0d0fee81872ba871972331339dc66cdf13a 100644 (file)
@@ -4503,10 +4503,10 @@ static int __devinit snd_hdspm_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       card = snd_card_new(index[dev], id[dev],
-                           THIS_MODULE, sizeof(struct hdspm));
-       if (!card)
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev],
+                             THIS_MODULE, sizeof(struct hdspm), &card);
+       if (err < 0)
+               return err;
 
        hdspm = card->private_data;
        card->private_free = snd_hdspm_card_free;
index 2570907134d75cd89067b14865fbd90355749df9..bc539abb210582c01797a4115916e00088f3be92 100644 (file)
@@ -2594,11 +2594,11 @@ static int __devinit snd_rme9652_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE,
-                           sizeof(struct snd_rme9652));
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE,
+                             sizeof(struct snd_rme9652), &card);
 
-       if (!card)
-               return -ENOMEM;
+       if (err < 0)
+               return err;
 
        rme9652 = (struct snd_rme9652 *) card->private_data;
        card->private_free = snd_rme9652_card_free;
index df2007e3be7cbf63bb18f68c3ee144b6b5a1520b..baf6d8e3dabc3e703f21337c79f5c25fceb6926c 100644 (file)
@@ -1387,9 +1387,8 @@ static int __devinit snd_sis7019_probe(struct pci_dev *pci,
        if (!enable)
                goto error_out;
 
-       rc = -ENOMEM;
-       card = snd_card_new(index, id, THIS_MODULE, sizeof(*sis));
-       if (!card)
+       rc = snd_card_create(index, id, THIS_MODULE, sizeof(*sis), &card);
+       if (rc < 0)
                goto error_out;
 
        strcpy(card->driver, "SiS7019");
index cd408b86c839b1833e6f6a743f3459cc780cf10a..c5601b0ad7cc4b8c52142d5f1da3e1ffad536dbb 100644 (file)
@@ -1423,9 +1423,9 @@ static int __devinit snd_sonic_probe(struct pci_dev *pci,
                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;
        for (idx = 0; idx < 5; idx++) {
                if (pci_resource_start(pci, idx) == 0 ||
                    !(pci_resource_flags(pci, idx) & IORESOURCE_IO)) {
index d94b16ffb38554660a8bd2647ad4d9024be2927f..21cef97d478dc8fb0a127d73453714d886facedf 100644 (file)
@@ -89,9 +89,9 @@ static int __devinit snd_trident_probe(struct pci_dev *pci,
                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;
 
        if ((err = snd_trident_create(card, pci,
                                      pcm_channels[dev],
index 1aafe956ee2b348d07d02925b6aa1fdd9ec7f7ee..d8705547dae106fb203193e0a3a8d892bbe48bb5 100644 (file)
@@ -2433,9 +2433,9 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
        unsigned int i;
        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;
 
        card_type = pci_id->driver_data;
        switch (card_type) {
index 5bd79d2a5a1555d80ba7466eca75baab6804714b..c086b762c150a30cfa651c7ff5b7805ad2c461da 100644 (file)
@@ -1167,9 +1167,9 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
        unsigned int i;
        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;
 
        card_type = pci_id->driver_data;
        switch (card_type) {
index acc352f4a44182f5f782fae7301d8bdde0eec235..fc9136c3e0d7824a67d88d4bbc5781e4b7ac375d 100644 (file)
@@ -204,9 +204,9 @@ static int __devinit snd_vx222_probe(struct pci_dev *pci,
                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;
 
        switch ((int)pci_id->driver_data) {
        case VX_PCI_VX222_OLD:
index 2631a554845e66c32ac446c283076061f092cfb3..4af66661f9b020b83956559847848b51647fde97 100644 (file)
@@ -187,9 +187,9 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci,
                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;
 
        switch (pci_id->device) {
        case 0x0004: str = "YMF724";  model = "DS-1"; break;