OSDN Git Service

ALSA: pci: Convert to snd_card_new() with a device pointer
authorTakashi Iwai <tiwai@suse.de>
Wed, 29 Jan 2014 13:20:19 +0000 (14:20 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 12 Feb 2014 10:17:52 +0000 (11:17 +0100)
Also remove superfluous snd_card_set_dev() calls.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
56 files changed:
sound/pci/ad1889.c
sound/pci/ali5451/ali5451.c
sound/pci/als300.c
sound/pci/als4000.c
sound/pci/asihpi/asihpi.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/cs46xx/cs46xx_lib.c
sound/pci/cs5530.c
sound/pci/cs5535audio/cs5535audio.c
sound/pci/ctxfi/ctatc.c
sound/pci/ctxfi/xfi.c
sound/pci/echoaudio/echoaudio.c
sound/pci/emu10k1/emu10k1.c
sound/pci/emu10k1/emu10k1_main.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/lola/lola.c
sound/pci/lx6464es/lx6464es.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/trident/trident_main.c
sound/pci/via82xx.c
sound/pci/via82xx_modem.c
sound/pci/vx222/vx222.c
sound/pci/ymfpci/ymfpci.c
sound/pci/ymfpci/ymfpci_main.c

index b680d03..ba4da1e 100644 (file)
@@ -965,8 +965,6 @@ snd_ad1889_create(struct snd_card *card,
                return err;
        }
 
-       snd_card_set_dev(card, &pci->dev);
-
        *rchip = chip;
 
        return 0;
@@ -996,7 +994,8 @@ snd_ad1889_probe(struct pci_dev *pci,
        }
 
        /* (2) */
-       err = snd_card_create(index[devno], id[devno], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[devno], id[devno], THIS_MODULE,
+                          0, &card);
        /* XXX REVISIT: we can probably allocate chip in this call */
        if (err < 0)
                return err;
index c6835a3..115b112 100644 (file)
@@ -2218,8 +2218,6 @@ static int snd_ali_create(struct snd_card *card,
                return err;
        }
 
-       snd_card_set_dev(card, &pci->dev);
-
        /* initialise synth voices*/
        for (i = 0; i < ALI_CHANNELS; i++)
                codec->synth.voices[i].number = i;
@@ -2253,7 +2251,7 @@ static int snd_ali_probe(struct pci_dev *pci,
 
        snd_ali_printk("probe ...\n");
 
-       err = snd_card_create(index, id, THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index, id, THIS_MODULE, 0, &card);
        if (err < 0)
                return err;
 
index 591efb6..9acd88a 100644 (file)
@@ -761,8 +761,6 @@ static int snd_als300_create(struct snd_card *card,
                return err;
        }
 
-       snd_card_set_dev(card, &pci->dev);
-
        *rchip = chip;
        snd_als300_dbgcallleave();
        return 0;
@@ -829,7 +827,8 @@ static int snd_als300_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
 
        if (err < 0)
                return err;
index ffc821b..2b2bb0f 100644 (file)
@@ -888,9 +888,9 @@ static int snd_card_als4000_probe(struct pci_dev *pci,
        pci_write_config_word(pci, PCI_COMMAND, word | PCI_COMMAND_IO);
        pci_set_master(pci);
        
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 
-                             sizeof(*acard) /* private_data: acard */,
-                             &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          sizeof(*acard) /* private_data: acard */,
+                          &card);
        if (err < 0) {
                pci_release_regions(pci);
                pci_disable_device(pci);
@@ -920,7 +920,6 @@ static int snd_card_als4000_probe(struct pci_dev *pci,
 
        chip->pci = pci;
        chip->alt_port = iobase;
-       snd_card_set_dev(card, &pci->dev);
 
        snd_als4000_configure(chip);
 
index 5f2acd3..e4e42f2 100644 (file)
@@ -2827,17 +2827,13 @@ static int snd_asihpi_probe(struct pci_dev *pci_dev,
        hpi = pci_get_drvdata(pci_dev);
        adapter_index = hpi->adapter->index;
        /* first try to give the card the same index as its hardware index */
-       err = snd_card_create(adapter_index,
-                             id[adapter_index], THIS_MODULE,
-                             sizeof(struct snd_card_asihpi),
-                             &card);
+       err = snd_card_new(&pci_dev->dev, adapter_index, id[adapter_index],
+                          THIS_MODULE, sizeof(struct snd_card_asihpi), &card);
        if (err < 0) {
                /* if that fails, try the default index==next available */
-               err =
-                   snd_card_create(index[dev], id[dev],
-                                   THIS_MODULE,
-                                   sizeof(struct snd_card_asihpi),
-                                   &card);
+               err = snd_card_new(&pci_dev->dev, index[dev], id[dev],
+                                  THIS_MODULE, sizeof(struct snd_card_asihpi),
+                                  &card);
                if (err < 0)
                        return err;
                snd_printk(KERN_WARNING
@@ -2845,8 +2841,6 @@ static int snd_asihpi_probe(struct pci_dev *pci_dev,
                        adapter_index, card->number);
        }
 
-       snd_card_set_dev(card, &pci_dev->dev);
-
        asihpi = card->private_data;
        asihpi->card = card;
        asihpi->pci = pci_dev;
index f6dec3e..85f893b 100644 (file)
@@ -1657,8 +1657,6 @@ static int snd_atiixp_create(struct snd_card *card,
                return err;
        }
 
-       snd_card_set_dev(card, &pci->dev);
-
        *r_chip = chip;
        return 0;
 }
@@ -1671,7 +1669,7 @@ static int snd_atiixp_probe(struct pci_dev *pci,
        struct atiixp *chip;
        int err;
 
-       err = snd_card_create(index, id, THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index, id, THIS_MODULE, 0, &card);
        if (err < 0)
                return err;
 
index 289563e..2b3244a 100644 (file)
@@ -1282,8 +1282,6 @@ static int snd_atiixp_create(struct snd_card *card,
                return err;
        }
 
-       snd_card_set_dev(card, &pci->dev);
-
        *r_chip = chip;
        return 0;
 }
@@ -1296,7 +1294,7 @@ static int snd_atiixp_probe(struct pci_dev *pci,
        struct atiixp_modem *chip;
        int err;
 
-       err = snd_card_create(index, id, THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index, id, THIS_MODULE, 0, &card);
        if (err < 0)
                return err;
 
index 7059dd6..afb1b44 100644 (file)
@@ -211,8 +211,6 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
                goto alloc_out;
        }
 
-       snd_card_set_dev(card, &pci->dev);
-
        *rchip = chip;
 
        return 0;
@@ -250,7 +248,8 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
                return -ENOENT;
        }
        // (2)
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
 
index 2925220..e9dabee 100644 (file)
@@ -322,7 +322,6 @@ static int snd_aw2_create(struct snd_card *card,
                return err;
        }
 
-       snd_card_set_dev(card, &pci->dev);
        *rchip = chip;
 
        printk(KERN_INFO
@@ -349,7 +348,8 @@ static int snd_aw2_probe(struct pci_dev *pci,
        }
 
        /* (2) Create card instance */
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
 
index 1aef712..641c235 100644 (file)
@@ -2599,8 +2599,6 @@ snd_azf3328_create(struct snd_card *card,
                spin_unlock_irq(codec->lock);
        }
 
-       snd_card_set_dev(card, &pci->dev);
-
        *rchip = chip;
 
        err = 0;
@@ -2635,7 +2633,8 @@ snd_azf3328_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
                goto out;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                goto out;
 
index 1880203..06dc7d9 100644 (file)
@@ -773,7 +773,6 @@ static int snd_bt87x_create(struct snd_card *card,
        if (err < 0)
                goto fail;
 
-       snd_card_set_dev(card, &pci->dev);
        *rchip = chip;
        return 0;
 
@@ -888,7 +887,8 @@ static int snd_bt87x_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
 
index f4db558..f659c7a 100644 (file)
@@ -1843,7 +1843,8 @@ static int snd_ca0106_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
 
@@ -1878,8 +1879,6 @@ static int snd_ca0106_probe(struct pci_dev *pci,
        snd_ca0106_proc_init(chip);
 #endif
 
-       snd_card_set_dev(card, &pci->dev);
-
        err = snd_card_register(card);
        if (err < 0)
                goto error;
index 2755ec5..66c0558 100644 (file)
@@ -3254,8 +3254,6 @@ static int snd_cmipci_create(struct snd_card *card, struct pci_dev *pci,
        if (snd_cmipci_create_gameport(cm, dev) < 0)
                snd_cmipci_clear_bit(cm, CM_REG_FUNCTRL1, CM_JYSTK_EN);
 
-       snd_card_set_dev(card, &pci->dev);
-
        *rcmipci = cm;
        return 0;
 }
@@ -3280,7 +3278,8 @@ static int snd_cmipci_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
        
index 1dc793e..2bd5517 100644 (file)
@@ -1402,8 +1402,6 @@ static int snd_cs4281_create(struct snd_card *card,
 
        snd_cs4281_proc_init(chip);
 
-       snd_card_set_dev(card, &pci->dev);
-
        *rchip = chip;
        return 0;
 }
@@ -1917,7 +1915,8 @@ static int snd_cs4281_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
 
index b034983..af0eacb 100644 (file)
@@ -88,7 +88,8 @@ static int snd_card_cs46xx_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
        if ((err = snd_cs46xx_create(card, pci,
index 062398e..2876647 100644 (file)
@@ -4058,8 +4058,6 @@ int snd_cs46xx_create(struct snd_card *card,
 
        chip->active_ctrl(chip, -1); /* disable CLKRUN */
 
-       snd_card_set_dev(card, &pci->dev);
-
        *rchip = chip;
        return 0;
 }
index c6b82c8..8037e86 100644 (file)
@@ -244,7 +244,6 @@ static int snd_cs5530_create(struct snd_card *card,
                return err;
        }
 
-       snd_card_set_dev(card, &pci->dev);
        *rchip = chip;
        return 0;
 }
@@ -264,7 +263,8 @@ static int snd_cs5530_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
 
        if (err < 0)
                return err;
index c0d2835..051b3e2 100644 (file)
@@ -324,8 +324,6 @@ static int snd_cs5535audio_create(struct snd_card *card,
                                  cs5535au, &ops)) < 0)
                goto sndfail;
 
-       snd_card_set_dev(card, &pci->dev);
-
        *rcs5535au = cs5535au;
        return 0;
 
@@ -353,7 +351,8 @@ static int snd_cs5535audio_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
 
index eb86829..af632bd 100644 (file)
@@ -1739,8 +1739,6 @@ int ct_atc_create(struct snd_card *card, struct pci_dev *pci,
        if (err < 0)
                goto error1;
 
-       snd_card_set_dev(card, &pci->dev);
-
        *ratc = atc;
        return 0;
 
index d464ad2..98426d0 100644 (file)
@@ -71,7 +71,8 @@ ct_card_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
                dev++;
                return -ENOENT;
        }
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err)
                return err;
        if ((reference_rate != 48000) && (reference_rate != 44100)) {
index 05cfe55..1ef77c0 100644 (file)
@@ -2058,12 +2058,11 @@ static int snd_echo_probe(struct pci_dev *pci,
 
        DE_INIT(("Echoaudio driver starting...\n"));
        i = 0;
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
 
-       snd_card_set_dev(card, &pci->dev);
-
        chip = NULL;    /* Tells snd_echo_create to allocate chip */
        if ((err = snd_echo_create(card, pci, &chip)) < 0) {
                snd_card_free(card);
index 9e1bd0c..5c0413b 100644 (file)
@@ -117,7 +117,8 @@ static int snd_card_emu10k1_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
        if (max_buffer_size[dev] < 32)
index bdd888e..75504da 100644 (file)
@@ -2021,7 +2021,6 @@ int snd_emu10k1_create(struct snd_card *card,
        snd_emu10k1_proc_init(emu);
 #endif
 
-       snd_card_set_dev(card, &pci->dev);
        *remu = emu;
        return 0;
 
index 56ad9d6..3988eaa 100644 (file)
@@ -1564,7 +1564,8 @@ static int snd_emu10k1x_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
 
@@ -1608,8 +1609,6 @@ static int snd_emu10k1x_probe(struct pci_dev *pci,
        sprintf(card->longname, "%s at 0x%lx irq %i",
                card->shortname, chip->port, chip->irq);
 
-       snd_card_set_dev(card, &pci->dev);
-
        if ((err = snd_card_register(card)) < 0) {
                snd_card_free(card);
                return err;
index 61262f3..0f89d2a 100644 (file)
@@ -2180,8 +2180,6 @@ static int snd_ensoniq_create(struct snd_card *card,
 
        snd_ensoniq_proc_init(ensoniq);
 
-       snd_card_set_dev(card, &pci->dev);
-
        *rensoniq = ensoniq;
        return 0;
 }
@@ -2437,7 +2435,8 @@ static int snd_audiopci_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
 
index 9213fb3..33489bc 100644 (file)
@@ -1658,8 +1658,6 @@ static int snd_es1938_create(struct snd_card *card,
                return err;
        }
 
-       snd_card_set_dev(card, &pci->dev);
-
        *rchip = chip;
        return 0;
 }
@@ -1808,7 +1806,8 @@ static int snd_es1938_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
        for (idx = 0; idx < 5; idx++) {
index 772cc36..87e9cd5 100644 (file)
@@ -2783,8 +2783,6 @@ static int snd_es1968_create(struct snd_card *card,
                return err;
        }
 
-       snd_card_set_dev(card, &pci->dev);
-
 #ifdef CONFIG_SND_ES1968_RADIO
        /* don't play with GPIOs on laptops */
        if (chip->pci->subsystem_vendor != 0x125d)
@@ -2836,7 +2834,8 @@ static int snd_es1968_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
                 
index 45bc8a9..8b6af21 100644 (file)
@@ -1251,8 +1251,6 @@ static int snd_fm801_create(struct snd_card *card,
                return err;
        }
 
-       snd_card_set_dev(card, &pci->dev);
-
 #ifdef CONFIG_SND_FM801_TEA575X_BOOL
        err = v4l2_device_register(&pci->dev, &chip->v4l2_dev);
        if (err < 0) {
@@ -1312,7 +1310,8 @@ static int snd_card_fm801_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
        if ((err = snd_fm801_create(card, pci, tea575x_tuner[dev], radio_nr[dev], &chip)) < 0) {
index d8d9bf3..0870f5f 100644 (file)
@@ -3823,14 +3823,13 @@ static int azx_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0) {
                snd_printk(KERN_ERR "hda-intel: Error creating card!\n");
                return err;
        }
 
-       snd_card_set_dev(card, &pci->dev);
-
        err = azx_create(card, pci, dev, pci_id->driver_data, &chip);
        if (err < 0)
                goto out_free;
index 28ec872..99c022a 100644 (file)
@@ -2639,8 +2639,6 @@ static int snd_ice1712_create(struct snd_card *card,
                return err;
        }
 
-       snd_card_set_dev(card, &pci->dev);
-
        *r_ice1712 = ice;
        return 0;
 }
@@ -2670,7 +2668,8 @@ static int snd_ice1712_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
 
index 5004717..cf1ba11 100644 (file)
@@ -2609,8 +2609,6 @@ static int snd_vt1724_create(struct snd_card *card,
                return err;
        }
 
-       snd_card_set_dev(card, &pci->dev);
-
        *r_ice1712 = ice;
        return 0;
 }
@@ -2638,7 +2636,8 @@ static int snd_vt1724_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
 
index 08d8733..ff24acf 100644 (file)
@@ -3217,8 +3217,6 @@ static int snd_intel8x0_create(struct snd_card *card,
                return err;
        }
 
-       snd_card_set_dev(card, &pci->dev);
-
        *r_intel8x0 = chip;
        return 0;
 }
@@ -3285,7 +3283,7 @@ static int snd_intel8x0_probe(struct pci_dev *pci,
        int err;
        struct shortname_table *name;
 
-       err = snd_card_create(index, id, THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index, id, THIS_MODULE, 0, &card);
        if (err < 0)
                return err;
 
index 3573c11..f8c72bd 100644 (file)
@@ -1243,8 +1243,6 @@ static int snd_intel8x0m_create(struct snd_card *card,
                return err;
        }
 
-       snd_card_set_dev(card, &pci->dev);
-
        *r_intel8x0m = chip;
        return 0;
 }
@@ -1283,7 +1281,7 @@ static int snd_intel8x0m_probe(struct pci_dev *pci,
        int err;
        struct shortname_table *name;
 
-       err = snd_card_create(index, id, THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index, id, THIS_MODULE, 0, &card);
        if (err < 0)
                return err;
 
index 9cf9829..8f36d77 100644 (file)
@@ -2418,8 +2418,6 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci,
 
         snd_korg1212_proc_init(korg1212);
         
-       snd_card_set_dev(card, &pci->dev);
-
         * rchip = korg1212;
        return 0;
 
@@ -2445,7 +2443,8 @@ snd_korg1212_probe(struct pci_dev *pci,
                dev++;
                return -ENOENT;
        }
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
 
index 0568540..56d4f94 100644 (file)
@@ -717,14 +717,13 @@ static int lola_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0) {
                snd_printk(KERN_ERR SFX "Error creating card!\n");
                return err;
        }
 
-       snd_card_set_dev(card, &pci->dev);
-
        err = lola_create(card, pci, dev, &chip);
        if (err < 0)
                goto out_free;
index 5fcaaa6..b9743d4 100644 (file)
@@ -1062,8 +1062,6 @@ static int snd_lx6464es_create(struct snd_card *card,
        if (err < 0)
                return err;
 
-       snd_card_set_dev(card, &pci->dev);
-
        *rchip = chip;
        return 0;
 
@@ -1099,7 +1097,8 @@ static int snd_lx6464es_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
 
index d541736..076c3ec 100644 (file)
@@ -2693,8 +2693,6 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
        snd_m3_enable_ints(chip);
        snd_m3_assp_continue(chip);
 
-       snd_card_set_dev(card, &pci->dev);
-
        *chip_ret = chip;
 
        return 0; 
@@ -2721,7 +2719,8 @@ snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
 
index 1e0f6ee..9ab057b 100644 (file)
@@ -1028,8 +1028,6 @@ static int snd_mixart_create(struct mixart_mgr *mgr, struct snd_card *card, int
        }
 
        mgr->chip[idx] = chip;
-       snd_card_set_dev(card, &mgr->pci->dev);
-
        return 0;
 }
 
@@ -1308,7 +1306,8 @@ static int snd_mixart_probe(struct pci_dev *pci,
                else
                        idx = index[dev] + i;
                snprintf(tmpid, sizeof(tmpid), "%s-%d", id[dev] ? id[dev] : "MIXART", i);
-               err = snd_card_create(idx, tmpid, THIS_MODULE, 0, &card);
+               err = snd_card_new(&pci->dev, idx, tmpid, THIS_MODULE,
+                                  0, &card);
 
                if (err < 0) {
                        snd_printk(KERN_ERR "cannot allocate the card %d\n", i);
index fe79fff..b7afd9c 100644 (file)
@@ -1626,8 +1626,6 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci,
        if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0)
                goto __error;
 
-       snd_card_set_dev(card, &pci->dev);
-
        *chip_ret = chip;
        return 0;
 
@@ -1676,7 +1674,7 @@ static int snd_nm256_probe(struct pci_dev *pci,
                }
        }
 
-       err = snd_card_create(index, id, THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index, id, THIS_MODULE, 0, &card);
        if (err < 0)
                return err;
 
index b0cb48a..efa610c 100644 (file)
@@ -595,7 +595,8 @@ int oxygen_pci_probe(struct pci_dev *pci, int index, char *id,
        const struct pci_device_id *pci_id;
        int err;
 
-       err = snd_card_create(index, id, owner, sizeof(*chip), &card);
+       err = snd_card_new(&pci->dev, index, id, owner,
+                          sizeof(*chip), &card);
        if (err < 0)
                return err;
 
@@ -648,7 +649,6 @@ int oxygen_pci_probe(struct pci_dev *pci, int index, char *id,
        }
 
        pci_set_master(pci);
-       snd_card_set_dev(card, &pci->dev);
        card->private_free = oxygen_card_free;
 
        configure_pcie_bridge(pci);
index d379b28..3880f6d 100644 (file)
@@ -1239,7 +1239,6 @@ static int pcxhr_create(struct pcxhr_mgr *mgr,
        }
 
        mgr->chip[idx] = chip;
-       snd_card_set_dev(card, &mgr->pci->dev);
 
        return 0;
 }
@@ -1638,7 +1637,8 @@ static int pcxhr_probe(struct pci_dev *pci,
 
                snprintf(tmpid, sizeof(tmpid), "%s-%d",
                         id[dev] ? id[dev] : card_name, i);
-               err = snd_card_create(idx, tmpid, THIS_MODULE, 0, &card);
+               err = snd_card_new(&pci->dev, idx, tmpid, THIS_MODULE,
+                                  0, &card);
 
                if (err < 0) {
                        snd_printk(KERN_ERR "cannot allocate the card %d\n", i);
index 56cc891..b4a8278 100644 (file)
@@ -1916,8 +1916,6 @@ snd_riptide_create(struct snd_card *card, struct pci_dev *pci,
                return err;
        }
 
-       snd_card_set_dev(card, &pci->dev);
-
        *rchip = chip;
        return 0;
 }
@@ -2086,7 +2084,8 @@ snd_card_riptide_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
        err = snd_riptide_create(card, pci, &chip);
index cc26346..77465cc 100644 (file)
@@ -1938,15 +1938,14 @@ snd_rme32_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE,
-                             sizeof(struct rme32), &card);
+       err = snd_card_new(&pci->dev, 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;
        rme32->pci = pci;
-       snd_card_set_dev(card, &pci->dev);
         if (fullduplex[dev])
                rme32->fullduplex_mode = 1;
        if ((err = snd_rme32_create(rme32)) < 0) {
index 0236363..00d4611 100644 (file)
@@ -2475,15 +2475,14 @@ snd_rme96_probe(struct pci_dev *pci,
                dev++;
                return -ENOENT;
        }
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE,
-                             sizeof(struct rme96), &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          sizeof(struct rme96), &card);
        if (err < 0)
                return err;
        card->private_free = snd_rme96_card_free;
        rme96 = card->private_data;
        rme96->card = card;
        rme96->pci = pci;
-       snd_card_set_dev(card, &pci->dev);
        if ((err = snd_rme96_create(rme96)) < 0) {
                snd_card_free(card);
                return err;
index bd90c80..825fbbe 100644 (file)
@@ -5375,8 +5375,8 @@ static int snd_hdsp_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE,
-                             sizeof(struct hdsp), &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          sizeof(struct hdsp), &card);
        if (err < 0)
                return err;
 
@@ -5384,7 +5384,6 @@ static int snd_hdsp_probe(struct pci_dev *pci,
        card->private_free = snd_hdsp_card_free;
        hdsp->dev = dev;
        hdsp->pci = pci;
-       snd_card_set_dev(card, &pci->dev);
 
        if ((err = snd_hdsp_create(card, hdsp)) < 0) {
                snd_card_free(card);
index e98dc00..7601628 100644 (file)
@@ -7016,8 +7016,8 @@ static int snd_hdspm_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev],
-                       THIS_MODULE, sizeof(struct hdspm), &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev],
+                          THIS_MODULE, sizeof(struct hdspm), &card);
        if (err < 0)
                return err;
 
@@ -7026,8 +7026,6 @@ static int snd_hdspm_probe(struct pci_dev *pci,
        hdspm->dev = dev;
        hdspm->pci = pci;
 
-       snd_card_set_dev(card, &pci->dev);
-
        err = snd_hdspm_create(card, hdspm);
        if (err < 0) {
                snd_card_free(card);
index 1503ee3..a62d6e1 100644 (file)
@@ -2587,8 +2587,8 @@ static int snd_rme9652_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE,
-                             sizeof(struct snd_rme9652), &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          sizeof(struct snd_rme9652), &card);
 
        if (err < 0)
                return err;
@@ -2597,7 +2597,6 @@ static int snd_rme9652_probe(struct pci_dev *pci,
        card->private_free = snd_rme9652_card_free;
        rme9652->dev = dev;
        rme9652->pci = pci;
-       snd_card_set_dev(card, &pci->dev);
 
        if ((err = snd_rme9652_create(card, rme9652, precise_ptr[dev])) < 0) {
                snd_card_free(card);
index e413b4e..6b26b93 100644 (file)
@@ -1404,8 +1404,6 @@ static int sis_chip_create(struct snd_card *card,
        if (rc)
                goto error_out_cleanup;
 
-       snd_card_set_dev(card, &pci->dev);
-
        return 0;
 
 error_out_cleanup:
@@ -1440,7 +1438,8 @@ static int snd_sis7019_probe(struct pci_dev *pci,
        if (!codecs)
                codecs = SIS_PRIMARY_CODEC_PRESENT;
 
-       rc = snd_card_create(index, id, THIS_MODULE, sizeof(*sis), &card);
+       rc = snd_card_new(&pci->dev, index, id, THIS_MODULE,
+                         sizeof(*sis), &card);
        if (rc < 0)
                goto error_out;
 
index 2a46bf9..9ff408f 100644 (file)
@@ -1392,8 +1392,6 @@ static int snd_sonicvibes_create(struct snd_card *card,
 
        snd_sonicvibes_proc_init(sonic);
 
-       snd_card_set_dev(card, &pci->dev);
-
        *rsonic = sonic;
        return 0;
 }
@@ -1459,7 +1457,8 @@ static int snd_sonic_probe(struct pci_dev *pci,
                return -ENOENT;
        }
  
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
        for (idx = 0; idx < 5; idx++) {
index b3b588b..d852458 100644 (file)
@@ -89,7 +89,8 @@ static int snd_trident_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
 
index fb0e158..4f3c4be 100644 (file)
@@ -3664,7 +3664,6 @@ int snd_trident_create(struct snd_card *card,
        snd_trident_enable_eso(trident);
 
        snd_trident_proc_init(trident);
-       snd_card_set_dev(card, &pci->dev);
        *rtrident = trident;
        return 0;
 }
index 5ae6f04..20d2eee 100644 (file)
@@ -2441,8 +2441,6 @@ static int snd_via82xx_create(struct snd_card *card,
         * We call pci_set_master here because it does not hurt. */
        pci_set_master(pci);
 
-       snd_card_set_dev(card, &pci->dev);
-
        *r_via = chip;
        return 0;
 }
@@ -2544,7 +2542,7 @@ static int snd_via82xx_probe(struct pci_dev *pci,
        unsigned int i;
        int err;
 
-       err = snd_card_create(index, id, THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index, id, THIS_MODULE, 0, &card);
        if (err < 0)
                return err;
 
index ca19028..5197401 100644 (file)
@@ -1161,8 +1161,6 @@ static int snd_via82xx_create(struct snd_card *card,
         * We call pci_set_master here because it does not hurt. */
        pci_set_master(pci);
 
-       snd_card_set_dev(card, &pci->dev);
-
        *r_via = chip;
        return 0;
 }
@@ -1177,7 +1175,7 @@ static int snd_via82xx_probe(struct pci_dev *pci,
        unsigned int i;
        int err;
 
-       err = snd_card_create(index, id, THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index, id, THIS_MODULE, 0, &card);
        if (err < 0)
                return err;
 
index ab8a9b1..4323556 100644 (file)
@@ -181,8 +181,6 @@ static int snd_vx222_create(struct snd_card *card, struct pci_dev *pci,
                return err;
        }
 
-       snd_card_set_dev(card, &pci->dev);
-
        *rchip = vx;
        return 0;
 }
@@ -204,7 +202,8 @@ static int snd_vx222_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
 
index e8932b2..6ff4ea3 100644 (file)
@@ -187,7 +187,8 @@ static int snd_card_ymfpci_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+                          0, &card);
        if (err < 0)
                return err;
 
index d591c15..c7e98ff 100644 (file)
@@ -2487,8 +2487,6 @@ int snd_ymfpci_create(struct snd_card *card,
 
        snd_ymfpci_proc_init(card, chip);
 
-       snd_card_set_dev(card, &pci->dev);
-
        *rchip = chip;
        return 0;
 }