diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-01-29 14:20:19 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-02-12 11:17:52 +0100 |
commit | 60c5772b50fe8ce947685cfe3a80b9bf6ea92831 (patch) | |
tree | ad2d8a112bd708ff58f96ccb2ec7b15d88676379 | |
parent | 4323cc4d5b25b5138c0791e3c7d3b09bd7062b49 (diff) |
ALSA: pci: Convert to snd_card_new() with a device pointer
Also remove superfluous snd_card_set_dev() calls.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
56 files changed, 98 insertions, 156 deletions
diff --git a/sound/pci/ad1889.c b/sound/pci/ad1889.c index b680d03e241..ba4da1ed044 100644 --- a/sound/pci/ad1889.c +++ b/sound/pci/ad1889.c @@ -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; diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c index c6835a3d64f..115b1120319 100644 --- a/sound/pci/ali5451/ali5451.c +++ b/sound/pci/ali5451/ali5451.c @@ -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; diff --git a/sound/pci/als300.c b/sound/pci/als300.c index 591efb6eef0..9acd88ab93a 100644 --- a/sound/pci/als300.c +++ b/sound/pci/als300.c @@ -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; diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c index ffc821b0139..2b2bb0fa3bc 100644 --- a/sound/pci/als4000.c +++ b/sound/pci/als4000.c @@ -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); diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c index 5f2acd35dcb..e4e42f28177 100644 --- a/sound/pci/asihpi/asihpi.c +++ b/sound/pci/asihpi/asihpi.c @@ -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; diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index f6dec3ea371..85f893b5cc9 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c @@ -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; diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c index 289563ecb6d..2b3244a85cf 100644 --- a/sound/pci/atiixp_modem.c +++ b/sound/pci/atiixp_modem.c @@ -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; diff --git a/sound/pci/au88x0/au88x0.c b/sound/pci/au88x0/au88x0.c index 7059dd69e5e..afb1b44b741 100644 --- a/sound/pci/au88x0/au88x0.c +++ b/sound/pci/au88x0/au88x0.c @@ -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; diff --git a/sound/pci/aw2/aw2-alsa.c b/sound/pci/aw2/aw2-alsa.c index 2925220d3fc..e9dabee4280 100644 --- a/sound/pci/aw2/aw2-alsa.c +++ b/sound/pci/aw2/aw2-alsa.c @@ -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; diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c index 1aef7128f7c..641c235ab4d 100644 --- a/sound/pci/azt3328.c +++ b/sound/pci/azt3328.c @@ -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; diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c index 18802039497..06dc7d97cc0 100644 --- a/sound/pci/bt87x.c +++ b/sound/pci/bt87x.c @@ -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; diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index f4db5587e86..f659c7a89c0 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c @@ -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; diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c index 2755ec5bcc2..66c0558ce44 100644 --- a/sound/pci/cmipci.c +++ b/sound/pci/cmipci.c @@ -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; diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c index 1dc793e742d..2bd55177b1a 100644 --- a/sound/pci/cs4281.c +++ b/sound/pci/cs4281.c @@ -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; diff --git a/sound/pci/cs46xx/cs46xx.c b/sound/pci/cs46xx/cs46xx.c index b03498325d6..af0eacbc8bd 100644 --- a/sound/pci/cs46xx/cs46xx.c +++ b/sound/pci/cs46xx/cs46xx.c @@ -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, diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index 062398ec533..28766478f81 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c @@ -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; } diff --git a/sound/pci/cs5530.c b/sound/pci/cs5530.c index c6b82c85e04..8037e8600a7 100644 --- a/sound/pci/cs5530.c +++ b/sound/pci/cs5530.c @@ -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; diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c index c0d2835344d..051b3e28e34 100644 --- a/sound/pci/cs5535audio/cs5535audio.c +++ b/sound/pci/cs5535audio/cs5535audio.c @@ -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; diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c index eb86829529e..af632bd0832 100644 --- a/sound/pci/ctxfi/ctatc.c +++ b/sound/pci/ctxfi/ctatc.c @@ -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; diff --git a/sound/pci/ctxfi/xfi.c b/sound/pci/ctxfi/xfi.c index d464ad2fc7b..98426d09c8b 100644 --- a/sound/pci/ctxfi/xfi.c +++ b/sound/pci/ctxfi/xfi.c @@ -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)) { diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c index 05cfe551ce4..1ef77c0d39e 100644 --- a/sound/pci/echoaudio/echoaudio.c +++ b/sound/pci/echoaudio/echoaudio.c @@ -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); diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c index 9e1bd0c39a8..5c0413b40dc 100644 --- a/sound/pci/emu10k1/emu10k1.c +++ b/sound/pci/emu10k1/emu10k1.c @@ -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) diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index bdd888ec9a8..75504da6361 100644 --- a/sound/pci/emu10k1/emu10k1_main.c +++ b/sound/pci/emu10k1/emu10k1_main.c @@ -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; diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c index 56ad9d6f200..3988eaa778c 100644 --- a/sound/pci/emu10k1/emu10k1x.c +++ b/sound/pci/emu10k1/emu10k1x.c @@ -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; diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c index 61262f39600..0f89d2a2090 100644 --- a/sound/pci/ens1370.c +++ b/sound/pci/ens1370.c @@ -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; diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c index 9213fb38921..33489bcc0af 100644 --- a/sound/pci/es1938.c +++ b/sound/pci/es1938.c @@ -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++) { diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c index 772cc36f951..87e9cd5d3ce 100644 --- a/sound/pci/es1968.c +++ b/sound/pci/es1968.c @@ -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; diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index 45bc8a95b7c..8b6af212cbf 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c @@ -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) { diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index d8d9bf3c378..0870f5f3ed1 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -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; diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c index 28ec872e54c..99c022a0d61 100644 --- a/sound/pci/ice1712/ice1712.c +++ b/sound/pci/ice1712/ice1712.c @@ -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); |