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.
With no need to invoke rproc_del(), the remove() ops could be removed.
No functional changes.
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/20250926-imx_rproc_v3-v3-6-4c0ec279cc5f@nxp.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
return dev_err_probe(dev, ret, "pm_runtime get failed\n");
}
- ret = rproc_add(rproc);
+ ret = devm_rproc_add(dev, rproc);
if (ret) {
dev_err(dev, "rproc_add failed\n");
goto err_put_pm;
pm_runtime_disable(priv->dev);
pm_runtime_put_noidle(priv->dev);
}
- rproc_del(rproc);
}
static const struct imx_rproc_plat_ops imx_rproc_ops_arm_smc = {