From: Peng Fan Date: Wed, 19 Nov 2025 04:21:48 +0000 (+0800) Subject: remoteproc: imx_dsp_rproc: Use devm_pm_runtime_enable() helper X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=412060242303d3c6aae55b1e0b7d040c30bd207d;p=thirdparty%2Fkernel%2Flinux.git remoteproc: imx_dsp_rproc: Use devm_pm_runtime_enable() helper Current code on the cleanup path just disables runtime PM for a device. Using resource managed version devm_pm_runtime_enable() registers a cleanup callback that sets autosuspend to false and then disables runtime PM for a device. So, basically the same functionality as we don't use autosuspend anyway. As a result, the .remove callback is no longer needed, reducing boilerplate code. Reviewed-by: Frank Li Reviewed-by: Daniel Baluta Reviewed-by: Shengjiu Wang Reviewed-by: Iuliana Prodan Tested-by: Iuliana Prodan Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20251119-imx-dsp-2025-11-19-v4-3-adafd342d07b@nxp.com Signed-off-by: Mathieu Poirier --- diff --git a/drivers/remoteproc/imx_dsp_rproc.c b/drivers/remoteproc/imx_dsp_rproc.c index 418bd3ac70a4a..f5d0aec52c566 100644 --- a/drivers/remoteproc/imx_dsp_rproc.c +++ b/drivers/remoteproc/imx_dsp_rproc.c @@ -1200,14 +1200,7 @@ static int imx_dsp_rproc_probe(struct platform_device *pdev) rproc_coredump_set_elf_info(rproc, ELFCLASS32, EM_XTENSA); - pm_runtime_enable(dev); - - return 0; -} - -static void imx_dsp_rproc_remove(struct platform_device *pdev) -{ - pm_runtime_disable(&pdev->dev); + return devm_pm_runtime_enable(dev); } /* pm runtime functions */ @@ -1358,7 +1351,6 @@ MODULE_DEVICE_TABLE(of, imx_dsp_rproc_of_match); static struct platform_driver imx_dsp_rproc_driver = { .probe = imx_dsp_rproc_probe, - .remove = imx_dsp_rproc_remove, .driver = { .name = "imx-dsp-rproc", .of_match_table = imx_dsp_rproc_of_match,