Re: [PATCH 03/31] AsoC: intel/atom: Use pure devres PCI

On Wed, Apr 16, 2025 at 03:12:13PM +0200, Philipp Stanner wrote:
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 call to pci_release_regions(), since pcim_ functions do cleanup automatically.
Pass 0 as length parameter to pcim_iomap(), which is the standard way for ioremapping an entire BAR.
...
sound/soc/intel/atom/sst/sst_pci.c | 56 ++++++++++++------------------ 1 file changed, 23 insertions(+), 33 deletions(-)
Cool cleanup!
...
/* DRAM */ ctx->dram_end = pci_resource_end(pci, 4); ctx->dram_base = pci_resource_start(pci, 4);
- ctx->dram = pcim_iomap(pci, 4, 0);
- if (!ctx->dram)
return -EINVAL;
Why EINVAL and not ENOMEM? mapping is about memory, no?
- dev_dbg(ctx->dev, "DRAM Ptr %p\n", ctx->dram);
-do_release_regions:
- pci_release_regions(pci); return ret;
Now it seems
return 0;
should suffice here.
participants (1)
-
Andy Shevchenko