diff options
| author | Mark Brown <broonie@kernel.org> | 2025-05-06 08:42:25 +0900 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2025-05-06 08:42:25 +0900 |
| commit | 02ca7898185fcbfc5890f0a8e42664bcd95d94a1 (patch) | |
| tree | eb083c0ba0cd8c17565120e735685d6a268a6668 /sound/soc/sof | |
| parent | fe65ce845c0a5876e0f6b9d848a951a218f8e3b2 (diff) | |
| parent | 14a3fd030c033453d436233f4c422b4903786ed3 (diff) | |
AsoC: Phase out hybrid PCI devres
Merge series from Philipp Stanner <phasta@kernel.org>:
A year ago we spent quite some work trying to get PCI into better shape.
Some pci_ functions can be sometimes managed with devres, which is
obviously bad. We want to provide an obvious API, where pci_ functions
are never, and pcim_ functions are always managed.
Thus, everyone enabling his device with pcim_enable_device() must be
ported to pcim_ functions. Porting all users will later enable us to
significantly simplify parts of the PCI subsystem. See here [1] for
details.
This patch series does that for sound.
Feel free to squash the commits as you see fit.
P.
[1] https://elixir.bootlin.com/linux/v6.14-rc4/source/drivers/pci/devres.c#L18
Diffstat (limited to 'sound/soc/sof')
| -rw-r--r-- | sound/soc/sof/sof-pci-dev.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c index 2fc14b9a33d4..c50249aadea9 100644 --- a/sound/soc/sof/sof-pci-dev.c +++ b/sound/soc/sof/sof-pci-dev.c @@ -216,7 +216,7 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) if (ret < 0) return ret; - ret = pci_request_regions(pci, "Audio DSP"); + ret = pcim_request_all_regions(pci, "Audio DSP"); if (ret < 0) return ret; @@ -240,8 +240,7 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) path_override->ipc_type = sof_pci_ipc_type; } else { dev_err(dev, "Invalid IPC type requested: %d\n", sof_pci_ipc_type); - ret = -EINVAL; - goto out; + return -EINVAL; } path_override->fw_path = fw_path; @@ -271,13 +270,7 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) sof_pdata->sof_probe_complete = sof_pci_probe_complete; /* call sof helper for DSP hardware probe */ - ret = snd_sof_device_probe(dev, sof_pdata); - -out: - if (ret) - pci_release_regions(pci); - - return ret; + return snd_sof_device_probe(dev, sof_pdata); } EXPORT_SYMBOL_NS(sof_pci_probe, "SND_SOC_SOF_PCI_DEV"); @@ -290,9 +283,6 @@ void sof_pci_remove(struct pci_dev *pci) if (snd_sof_device_probe_completed(&pci->dev) && !(sof_pci_debug & SOF_PCI_DISABLE_PM_RUNTIME)) pm_runtime_get_noresume(&pci->dev); - - /* release pci regions and disable device */ - pci_release_regions(pci); } EXPORT_SYMBOL_NS(sof_pci_remove, "SND_SOC_SOF_PCI_DEV"); |
