Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: cavium-thunderx: Use non-hybrid PCI devres API

cavium-thunderx enables its PCI device with pcim_enable_device(). This,
implicitly, switches the function pci_request_regions() into managed
mode, where it becomes a devres function.

The PCI subsystem wants to remove this hybrid nature from its
interfaces. To do so, users of the aforementioned combination of
functions must be ported to non-hybrid functions.

Moreover, since both functions are already managed in this driver, the
calls to pci_release_regions() are unnecessary.

Remove the calls to pci_release_regions().

Replace the call to sometimes-managed pci_request_regions() with one to
the always-managed pcim_request_all_regions().

Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250417092742.27887-2-phasta@kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Philipp Stanner and committed by
Ulf Hansson
c02c658c fe1c2abf

+1 -3
+1 -3
drivers/mmc/host/cavium-thunderx.c
··· 72 72 if (ret) 73 73 return ret; 74 74 75 - ret = pci_request_regions(pdev, KBUILD_MODNAME); 75 + ret = pcim_request_all_regions(pdev, KBUILD_MODNAME); 76 76 if (ret) 77 77 return ret; 78 78 ··· 164 164 } 165 165 } 166 166 clk_disable_unprepare(host->clk); 167 - pci_release_regions(pdev); 168 167 return ret; 169 168 } 170 169 ··· 182 183 writeq(dma_cfg, host->dma_base + MIO_EMM_DMA_CFG(host)); 183 184 184 185 clk_disable_unprepare(host->clk); 185 - pci_release_regions(pdev); 186 186 } 187 187 188 188 static const struct pci_device_id thunder_mmc_id_table[] = {