ALSA: PCI: Remove superfluous pci_set_drvdata(pci, NULL) at remove
As drvdata is cleared to NULL at probe failure or at removal by the driver core, we don't have to call pci_set_drvdata(pci, NULL) any longer in each driver. The only remaining pci_set_drvdata(NULL) is in azx_firmware_cb() in hda_intel.c. Since this function itself releases the card instance, we need to clear drvdata here as well, so that it won't be released doubly in the remove callback. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
4059a42c51
commit
20a24225d8
@ -1046,7 +1046,6 @@ static void
|
||||
snd_ad1889_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static DEFINE_PCI_DEVICE_TABLE(snd_ad1889_ids) = {
|
||||
|
@ -2298,7 +2298,6 @@ static int snd_ali_probe(struct pci_dev *pci,
|
||||
static void snd_ali_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver ali5451_driver = {
|
||||
|
@ -282,7 +282,6 @@ static void snd_als300_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_als300_dbgcallenter();
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
snd_als300_dbgcallleave();
|
||||
}
|
||||
|
||||
|
@ -984,7 +984,6 @@ out:
|
||||
static void snd_card_als4000_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
@ -445,7 +445,6 @@ void asihpi_adapter_remove(struct pci_dev *pci_dev)
|
||||
if (pa->p_buffer)
|
||||
vfree(pa->p_buffer);
|
||||
|
||||
pci_set_drvdata(pci_dev, NULL);
|
||||
if (1)
|
||||
dev_info(&pci_dev->dev,
|
||||
"remove %04x:%04x,%04x:%04x,%04x, HPI index %d\n",
|
||||
|
@ -1714,7 +1714,6 @@ static int snd_atiixp_probe(struct pci_dev *pci,
|
||||
static void snd_atiixp_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver atiixp_driver = {
|
||||
|
@ -1334,7 +1334,6 @@ static int snd_atiixp_probe(struct pci_dev *pci,
|
||||
static void snd_atiixp_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver atiixp_modem_driver = {
|
||||
|
@ -371,7 +371,6 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
|
||||
static void snd_vortex_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
// pci_driver definition
|
||||
|
@ -392,7 +392,6 @@ static int snd_aw2_probe(struct pci_dev *pci,
|
||||
static void snd_aw2_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
/* open callback */
|
||||
|
@ -2725,7 +2725,6 @@ snd_azf3328_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_azf3328_dbgcallenter();
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
snd_azf3328_dbgcallleave();
|
||||
}
|
||||
|
||||
|
@ -953,7 +953,6 @@ _error:
|
||||
static void snd_bt87x_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
/* default entries for all Bt87x cards - it's not exported */
|
||||
|
@ -1896,7 +1896,6 @@ static int snd_ca0106_probe(struct pci_dev *pci,
|
||||
static void snd_ca0106_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
@ -3317,7 +3317,6 @@ static int snd_cmipci_probe(struct pci_dev *pci,
|
||||
static void snd_cmipci_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1971,7 +1971,6 @@ static int snd_cs4281_probe(struct pci_dev *pci,
|
||||
static void snd_cs4281_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -158,7 +158,6 @@ static int snd_card_cs46xx_probe(struct pci_dev *pci,
|
||||
static void snd_card_cs46xx_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver cs46xx_driver = {
|
||||
|
@ -91,7 +91,6 @@ static int snd_cs5530_dev_free(struct snd_device *device)
|
||||
static void snd_cs5530_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static u8 snd_cs5530_mixer_read(unsigned long io, u8 reg)
|
||||
|
@ -391,7 +391,6 @@ static void snd_cs5535audio_remove(struct pci_dev *pci)
|
||||
{
|
||||
olpc_quirks_cleanup();
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver cs5535audio_driver = {
|
||||
|
@ -122,7 +122,6 @@ error:
|
||||
static void ct_card_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
@ -2323,7 +2323,6 @@ static void snd_echo_remove(struct pci_dev *pci)
|
||||
chip = pci_get_drvdata(pci);
|
||||
if (chip)
|
||||
snd_card_free(chip->card);
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -202,7 +202,6 @@ static int snd_card_emu10k1_probe(struct pci_dev *pci,
|
||||
static void snd_card_emu10k1_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1623,7 +1623,6 @@ static int snd_emu10k1x_probe(struct pci_dev *pci,
|
||||
static void snd_emu10k1x_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
// PCI IDs
|
||||
|
@ -2497,7 +2497,6 @@ static int snd_audiopci_probe(struct pci_dev *pci,
|
||||
static void snd_audiopci_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver ens137x_driver = {
|
||||
|
@ -1881,7 +1881,6 @@ static int snd_es1938_probe(struct pci_dev *pci,
|
||||
static void snd_es1938_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver es1938_driver = {
|
||||
|
@ -2909,7 +2909,6 @@ static int snd_es1968_probe(struct pci_dev *pci,
|
||||
static void snd_es1968_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver es1968_driver = {
|
||||
|
@ -1370,7 +1370,6 @@ static int snd_card_fm801_probe(struct pci_dev *pci,
|
||||
static void snd_card_fm801_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
@ -3764,7 +3764,6 @@ static int azx_probe(struct pci_dev *pci,
|
||||
|
||||
out_free:
|
||||
snd_card_free(card);
|
||||
pci_set_drvdata(pci, NULL);
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -3834,7 +3833,6 @@ static void azx_remove(struct pci_dev *pci)
|
||||
|
||||
if (card)
|
||||
snd_card_free(card);
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
/* PCI IDs */
|
||||
|
@ -2807,7 +2807,6 @@ static void snd_ice1712_remove(struct pci_dev *pci)
|
||||
if (ice->card_info && ice->card_info->chip_exit)
|
||||
ice->card_info->chip_exit(ice);
|
||||
snd_card_free(card);
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver ice1712_driver = {
|
||||
|
@ -2800,7 +2800,6 @@ static void snd_vt1724_remove(struct pci_dev *pci)
|
||||
if (ice->card_info && ice->card_info->chip_exit)
|
||||
ice->card_info->chip_exit(ice);
|
||||
snd_card_free(card);
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
@ -3364,7 +3364,6 @@ static int snd_intel8x0_probe(struct pci_dev *pci,
|
||||
static void snd_intel8x0_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver intel8x0_driver = {
|
||||
|
@ -1328,7 +1328,6 @@ static int snd_intel8x0m_probe(struct pci_dev *pci,
|
||||
static void snd_intel8x0m_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver intel8x0m_driver = {
|
||||
|
@ -2473,7 +2473,6 @@ snd_korg1212_probe(struct pci_dev *pci,
|
||||
static void snd_korg1212_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver korg1212_driver = {
|
||||
|
@ -759,7 +759,6 @@ out_free:
|
||||
static void lola_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
/* PCI IDs */
|
||||
|
@ -1139,7 +1139,6 @@ out_free:
|
||||
static void snd_lx6464es_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2775,7 +2775,6 @@ snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
|
||||
static void snd_m3_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver m3_driver = {
|
||||
|
@ -1377,7 +1377,6 @@ static int snd_mixart_probe(struct pci_dev *pci,
|
||||
static void snd_mixart_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_mixart_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver mixart_driver = {
|
||||
|
@ -1746,7 +1746,6 @@ static int snd_nm256_probe(struct pci_dev *pci,
|
||||
static void snd_nm256_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -722,7 +722,6 @@ EXPORT_SYMBOL(oxygen_pci_probe);
|
||||
void oxygen_pci_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
EXPORT_SYMBOL(oxygen_pci_remove);
|
||||
|
||||
|
@ -1691,7 +1691,6 @@ static int pcxhr_probe(struct pci_dev *pci,
|
||||
static void pcxhr_remove(struct pci_dev *pci)
|
||||
{
|
||||
pcxhr_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver pcxhr_driver = {
|
||||
|
@ -2066,7 +2066,6 @@ static void snd_riptide_joystick_remove(struct pci_dev *pci)
|
||||
if (gameport) {
|
||||
release_region(gameport->io, 8);
|
||||
gameport_unregister_port(gameport);
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -2179,7 +2178,6 @@ snd_card_riptide_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
|
||||
static void snd_card_riptide_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver driver = {
|
||||
|
@ -1981,7 +1981,6 @@ snd_rme32_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
|
||||
static void snd_rme32_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver rme32_driver = {
|
||||
|
@ -2390,7 +2390,6 @@ snd_rme96_probe(struct pci_dev *pci,
|
||||
static void snd_rme96_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver rme96_driver = {
|
||||
|
@ -5412,7 +5412,6 @@ static int snd_hdsp_probe(struct pci_dev *pci,
|
||||
static void snd_hdsp_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver hdsp_driver = {
|
||||
|
@ -6737,7 +6737,6 @@ static int snd_hdspm_probe(struct pci_dev *pci,
|
||||
static void snd_hdspm_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver hdspm_driver = {
|
||||
|
@ -2628,7 +2628,6 @@ static int snd_rme9652_probe(struct pci_dev *pci,
|
||||
static void snd_rme9652_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver rme9652_driver = {
|
||||
|
@ -1481,7 +1481,6 @@ error_out:
|
||||
static void snd_sis7019_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver sis7019_driver = {
|
||||
|
@ -1528,7 +1528,6 @@ static int snd_sonic_probe(struct pci_dev *pci,
|
||||
static void snd_sonic_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver sonicvibes_driver = {
|
||||
|
@ -169,7 +169,6 @@ static int snd_trident_probe(struct pci_dev *pci,
|
||||
static void snd_trident_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver trident_driver = {
|
||||
|
@ -2646,7 +2646,6 @@ static int snd_via82xx_probe(struct pci_dev *pci,
|
||||
static void snd_via82xx_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver via82xx_driver = {
|
||||
|
@ -1227,7 +1227,6 @@ static int snd_via82xx_probe(struct pci_dev *pci,
|
||||
static void snd_via82xx_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver via82xx_modem_driver = {
|
||||
|
@ -254,7 +254,6 @@ static int snd_vx222_probe(struct pci_dev *pci,
|
||||
static void snd_vx222_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
@ -347,7 +347,6 @@ static int snd_card_ymfpci_probe(struct pci_dev *pci,
|
||||
static void snd_card_ymfpci_remove(struct pci_dev *pci)
|
||||
{
|
||||
snd_card_free(pci_get_drvdata(pci));
|
||||
pci_set_drvdata(pci, NULL);
|
||||
}
|
||||
|
||||
static struct pci_driver ymfpci_driver = {
|
||||
|
Loading…
Reference in New Issue
Block a user