mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
remoteproc: imx_dsp_rproc: Use devm_rproc_add() helper
Replace manual rproc_add() and cleanup logic with devm_rproc_add(), which ties the remoteproc lifecycle to the device's lifecycle. This simplifies error handling and ensures proper cleanup. No functional changes. Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com> Tested-by: Iuliana Prodan <iuliana.prodan@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20251119-imx-dsp-2025-11-19-v4-2-adafd342d07b@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
This commit is contained in:
committed by
Mathieu Poirier
parent
3003773ad6
commit
36951036a7
@@ -1194,7 +1194,7 @@ static int imx_dsp_rproc_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
init_completion(&priv->pm_comp);
|
init_completion(&priv->pm_comp);
|
||||||
rproc->auto_boot = false;
|
rproc->auto_boot = false;
|
||||||
ret = rproc_add(rproc);
|
ret = devm_rproc_add(dev, rproc);
|
||||||
if (ret)
|
if (ret)
|
||||||
return dev_err_probe(dev, ret, "rproc_add failed\n");
|
return dev_err_probe(dev, ret, "rproc_add failed\n");
|
||||||
|
|
||||||
@@ -1207,10 +1207,7 @@ static int imx_dsp_rproc_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
static void imx_dsp_rproc_remove(struct platform_device *pdev)
|
static void imx_dsp_rproc_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct rproc *rproc = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
pm_runtime_disable(&pdev->dev);
|
pm_runtime_disable(&pdev->dev);
|
||||||
rproc_del(rproc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pm runtime functions */
|
/* pm runtime functions */
|
||||||
|
|||||||
Reference in New Issue
Block a user