Skip to content

Commit

Permalink
ALSA: PCI: Remove superfluous pci_set_drvdata(pci, NULL) at remove
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tiwai committed May 29, 2013
1 parent 4059a42 commit 20a2422
Show file tree
Hide file tree
Showing 51 changed files with 0 additions and 53 deletions.
1 change: 0 additions & 1 deletion sound/pci/ad1889.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/ali5451/ali5451.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/als300.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
1 change: 0 additions & 1 deletion sound/pci/als4000.c
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,6 @@ static int snd_card_als4000_probe(struct pci_dev *pci,
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
Expand Down
1 change: 0 additions & 1 deletion sound/pci/asihpi/hpioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion sound/pci/atiixp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/atiixp_modem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/au88x0/au88x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion sound/pci/aw2/aw2-alsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 0 additions & 1 deletion sound/pci/azt3328.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
1 change: 0 additions & 1 deletion sound/pci/bt87x.c
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,6 @@ static int snd_bt87x_probe(struct pci_dev *pci,
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 */
Expand Down
1 change: 0 additions & 1 deletion sound/pci/ca0106/ca0106_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion sound/pci/cmipci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
1 change: 0 additions & 1 deletion sound/pci/cs4281.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down
1 change: 0 additions & 1 deletion sound/pci/cs46xx/cs46xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/cs5530.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion sound/pci/cs5535audio/cs5535audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/ctxfi/xfi.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ ct_card_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
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
Expand Down
1 change: 0 additions & 1 deletion sound/pci/echoaudio/echoaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
1 change: 0 additions & 1 deletion sound/pci/emu10k1/emu10k1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
1 change: 0 additions & 1 deletion sound/pci/emu10k1/emu10k1x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion sound/pci/ens1370.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/es1938.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/es1968.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/fm801.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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 */
Expand Down
1 change: 0 additions & 1 deletion sound/pci/ice1712/ice1712.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/ice1712/ice1724.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion sound/pci/intel8x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/intel8x0m.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/korg1212/korg1212.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/lola/lola.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,6 @@ static int lola_probe(struct pci_dev *pci,
static void lola_remove(struct pci_dev *pci)
{
snd_card_free(pci_get_drvdata(pci));
pci_set_drvdata(pci, NULL);
}

/* PCI IDs */
Expand Down
1 change: 0 additions & 1 deletion sound/pci/lx6464es/lx6464es.c
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,6 @@ static int snd_lx6464es_probe(struct pci_dev *pci,
static void snd_lx6464es_remove(struct pci_dev *pci)
{
snd_card_free(pci_get_drvdata(pci));
pci_set_drvdata(pci, NULL);
}


Expand Down
1 change: 0 additions & 1 deletion sound/pci/maestro3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/mixart/mixart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/nm256/nm256.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
1 change: 0 additions & 1 deletion sound/pci/oxygen/oxygen_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion sound/pci/pcxhr/pcxhr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 0 additions & 2 deletions sound/pci/riptide/riptide.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/rme32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/rme96.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/rme9652/hdsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/rme9652/hdspm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/rme9652/rme9652.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/sis7019.c
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,6 @@ static int snd_sis7019_probe(struct pci_dev *pci,
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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/sonicvibes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/trident/trident.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion sound/pci/via82xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Loading

0 comments on commit 20a2422

Please sign in to comment.