Skip to content

Commit 3df0bee

Browse files
glneomathieupoirier
authored andcommitted
remoteproc: wkup_m3: Use devm_rproc_add() helper
Use the device lifecycle managed add function. This helps prevent mistakes like deleting out of order in cleanup functions and forgetting to delete on error paths. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20250814153940.670564-4-afd@ti.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
1 parent 9b84eec commit 3df0bee

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

drivers/remoteproc/wkup_m3_rproc.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -210,20 +210,13 @@ static int wkup_m3_rproc_probe(struct platform_device *pdev)
210210

211211
dev_set_drvdata(dev, rproc);
212212

213-
ret = rproc_add(rproc);
213+
ret = devm_rproc_add(dev, rproc);
214214
if (ret)
215215
return dev_err_probe(dev, ret, "rproc_add failed\n");
216216

217217
return 0;
218218
}
219219

220-
static void wkup_m3_rproc_remove(struct platform_device *pdev)
221-
{
222-
struct rproc *rproc = platform_get_drvdata(pdev);
223-
224-
rproc_del(rproc);
225-
}
226-
227220
#ifdef CONFIG_PM
228221
static int wkup_m3_rpm_suspend(struct device *dev)
229222
{
@@ -242,7 +235,6 @@ static const struct dev_pm_ops wkup_m3_rproc_pm_ops = {
242235

243236
static struct platform_driver wkup_m3_rproc_driver = {
244237
.probe = wkup_m3_rproc_probe,
245-
.remove = wkup_m3_rproc_remove,
246238
.driver = {
247239
.name = "wkup_m3_rproc",
248240
.of_match_table = wkup_m3_rproc_of_match,

0 commit comments

Comments
 (0)