]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
remoteproc: wkup_m3: Use devm_rproc_add() helper
authorAndrew Davis <afd@ti.com>
Thu, 14 Aug 2025 15:39:40 +0000 (10:39 -0500)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Tue, 26 Aug 2025 15:47:00 +0000 (09:47 -0600)
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>
drivers/remoteproc/wkup_m3_rproc.c

index 30e9ecd75657fc722020630494d8b01e7b80be71..2d5bfbefcacc5b747e370e5f3e5ae47e0f213deb 100644 (file)
@@ -210,20 +210,13 @@ static int wkup_m3_rproc_probe(struct platform_device *pdev)
 
        dev_set_drvdata(dev, rproc);
 
-       ret = rproc_add(rproc);
+       ret = devm_rproc_add(dev, rproc);
        if (ret)
                return dev_err_probe(dev, ret, "rproc_add failed\n");
 
        return 0;
 }
 
-static void wkup_m3_rproc_remove(struct platform_device *pdev)
-{
-       struct rproc *rproc = platform_get_drvdata(pdev);
-
-       rproc_del(rproc);
-}
-
 #ifdef CONFIG_PM
 static int wkup_m3_rpm_suspend(struct device *dev)
 {
@@ -242,7 +235,6 @@ static const struct dev_pm_ops wkup_m3_rproc_pm_ops = {
 
 static struct platform_driver wkup_m3_rproc_driver = {
        .probe = wkup_m3_rproc_probe,
-       .remove = wkup_m3_rproc_remove,
        .driver = {
                .name = "wkup_m3_rproc",
                .of_match_table = wkup_m3_rproc_of_match,