Unverified Commit 58fa9c62 authored by Philipp Stanner's avatar Philipp Stanner Committed by Mark Brown
Browse files

ASoC: intel: avs: Use pure devres PCI



pci_request_regions() is a hybrid function which becomes managed if
pcim_enable_device() was called before. This hybrid nature is deprecated
and should not be used anymore.

Replace pci_request_regions() with the always-managed function
pcim_request_all_regions().

Remove the goto jump to pci_release_regions(), since pcim_ functions
clean up automatically.

Signed-off-by: default avatarPhilipp Stanner <phasta@kernel.org>
Link: https://patch.msgid.link/20250425081742.61623-4-phasta@kernel.org


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 45054bb1
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -445,7 +445,7 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
		return ret;
	}

	ret = pci_request_regions(pci, "AVS HDAudio");
	ret = pcim_request_all_regions(pci, "AVS HDAudio");
	if (ret < 0)
		return ret;

@@ -454,8 +454,7 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
	bus->remap_addr = pci_ioremap_bar(pci, 0);
	if (!bus->remap_addr) {
		dev_err(bus->dev, "ioremap error\n");
		ret = -ENXIO;
		goto err_remap_bar0;
		return -ENXIO;
	}

	adev->dsp_ba = pci_ioremap_bar(pci, 4);
@@ -512,8 +511,6 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
	iounmap(adev->dsp_ba);
err_remap_bar4:
	iounmap(bus->remap_addr);
err_remap_bar0:
	pci_release_regions(pci);
	return ret;
}

@@ -584,7 +581,6 @@ static void avs_pci_remove(struct pci_dev *pci)
	pci_free_irq_vectors(pci);
	iounmap(bus->remap_addr);
	iounmap(adev->dsp_ba);
	pci_release_regions(pci);

	/* Firmware is not needed anymore */
	avs_release_firmwares(adev);