Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20a24225 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

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: default avatarTakashi Iwai <tiwai@suse.de>
parent 4059a42c
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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) = {
+0 −1
Original line number Diff line number Diff line
@@ -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 = {
+0 −1
Original line number Diff line number Diff line
@@ -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();
}

+0 −1
Original line number Diff line number Diff line
@@ -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
+0 −1
Original line number Diff line number Diff line
@@ -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",
Loading