summaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc
diff options
context:
space:
mode:
authorAndrew Davis <afd@ti.com>2024-02-05 12:27:53 -0600
committerMathieu Poirier <mathieu.poirier@linaro.org>2024-02-05 13:37:21 -0700
commit456a75ab51967c4c594519795a9f49c40662c291 (patch)
tree2c1f27fcea475014f908dd52e9867820a1933cda /drivers/remoteproc
parent8a5d6899e9a5377e8f3e95bf0a64a6d331876b6c (diff)
downloadlinux-456a75ab51967c4c594519795a9f49c40662c291.tar.gz
linux-456a75ab51967c4c594519795a9f49c40662c291.tar.bz2
linux-456a75ab51967c4c594519795a9f49c40662c291.zip
remoteproc: k3-dsp: Use devm_rproc_add() helper
Use device lifecycle managed devm_rproc_add() helper function. This helps prevent mistakes like deleting out of order in cleanup functions and forgetting to delete on all error paths. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20240205182753.36978-6-afd@ti.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r--drivers/remoteproc/ti_k3_dsp_remoteproc.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/remoteproc/ti_k3_dsp_remoteproc.c b/drivers/remoteproc/ti_k3_dsp_remoteproc.c
index f799f74734b4..3555b535b168 100644
--- a/drivers/remoteproc/ti_k3_dsp_remoteproc.c
+++ b/drivers/remoteproc/ti_k3_dsp_remoteproc.c
@@ -768,7 +768,7 @@ static int k3_dsp_rproc_probe(struct platform_device *pdev)
}
}
- ret = rproc_add(rproc);
+ ret = devm_rproc_add(dev, rproc);
if (ret)
return dev_err_probe(dev, ret, "failed to add register device with remoteproc core\n");
@@ -786,14 +786,9 @@ static void k3_dsp_rproc_remove(struct platform_device *pdev)
if (rproc->state == RPROC_ATTACHED) {
ret = rproc_detach(rproc);
- if (ret) {
- /* Note this error path leaks resources */
+ if (ret)
dev_err(dev, "failed to detach proc (%pe)\n", ERR_PTR(ret));
- return;
- }
}
-
- rproc_del(kproc->rproc);
}
static const struct k3_dsp_mem_data c66_mems[] = {