Skip to content

Commit 45054bb

Browse files
Philipp Stannerbroonie
authored andcommitted
ASoC: sof: 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 surplus calls to PCI release functions, since pcim_ functions do cleanup automatically. Signed-off-by: Philipp Stanner <[email protected]> Reviewed-by: Cezary Rojewski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 92a09c4 commit 45054bb

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

sound/soc/sof/sof-pci-dev.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
216216
if (ret < 0)
217217
return ret;
218218

219-
ret = pci_request_regions(pci, "Audio DSP");
219+
ret = pcim_request_all_regions(pci, "Audio DSP");
220220
if (ret < 0)
221221
return ret;
222222

@@ -240,8 +240,7 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
240240
path_override->ipc_type = sof_pci_ipc_type;
241241
} else {
242242
dev_err(dev, "Invalid IPC type requested: %d\n", sof_pci_ipc_type);
243-
ret = -EINVAL;
244-
goto out;
243+
return -EINVAL;
245244
}
246245

247246
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)
271270
sof_pdata->sof_probe_complete = sof_pci_probe_complete;
272271

273272
/* call sof helper for DSP hardware probe */
274-
ret = snd_sof_device_probe(dev, sof_pdata);
275-
276-
out:
277-
if (ret)
278-
pci_release_regions(pci);
279-
280-
return ret;
273+
return snd_sof_device_probe(dev, sof_pdata);
281274
}
282275
EXPORT_SYMBOL_NS(sof_pci_probe, "SND_SOC_SOF_PCI_DEV");
283276

@@ -290,9 +283,6 @@ void sof_pci_remove(struct pci_dev *pci)
290283
if (snd_sof_device_probe_completed(&pci->dev) &&
291284
!(sof_pci_debug & SOF_PCI_DISABLE_PM_RUNTIME))
292285
pm_runtime_get_noresume(&pci->dev);
293-
294-
/* release pci regions and disable device */
295-
pci_release_regions(pci);
296286
}
297287
EXPORT_SYMBOL_NS(sof_pci_remove, "SND_SOC_SOF_PCI_DEV");
298288

0 commit comments

Comments
 (0)