Commit 3e537877 authored by Philipp Stanner's avatar Philipp Stanner Committed by Niklas Cassel
Browse files

ata: pata_macio: Fix PCI region leak



pci_request_regions() became a managed devres functions if the PCI
device was enabled with pcim_enable_device(), which is the case for
pata_macio.

The PCI subsystem recently removed this hybrid feature from
pci_request_region(). When doing so, pata_macio was forgotten to be
ported to use pcim_request_all_regions(). If that function is not used,
pata_macio will fail on driver-reload because the PCI regions will
remain blocked.

Fix the region leak by replacing pci_request_regions() with its managed
counterpart, pcim_request_all_regions().

Fixes: 51f6aec9 ("PCI: Remove hybrid devres nature from request functions")
Signed-off-by: default avatarPhilipp Stanner <phasta@kernel.org>
Reviewed-by: default avatarKuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reviewed-by: default avatarDamien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20250610135413.35930-2-phasta@kernel.org


Signed-off-by: default avatarNiklas Cassel <cassel@kernel.org>
parent fe5b391f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1298,7 +1298,7 @@ static int pata_macio_pci_attach(struct pci_dev *pdev,
	priv->dev = &pdev->dev;

	/* Get MMIO regions */
	if (pci_request_regions(pdev, "pata-macio")) {
	if (pcim_request_all_regions(pdev, "pata-macio")) {
		dev_err(&pdev->dev,
			"Cannot obtain PCI resources\n");
		return -EBUSY;