]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
remoteproc: wkup_m3: Use devm_pm_runtime_enable() helper
authorAndrew Davis <afd@ti.com>
Thu, 14 Aug 2025 15:39:37 +0000 (10:39 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:34:15 +0000 (15:34 -0500)
[ Upstream commit 461edcf73eec57bc0006fbb5209f5012c514c58b ]

Use device life-cycle managed runtime enable function to simplify probe
and exit paths.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20250814153940.670564-1-afd@ti.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/remoteproc/wkup_m3_rproc.c

index 36a55f7ffa64d535cd832af8ce4ea28da505f368..c39bd2bf2c1e781ef8f8cb7071f44a55fac2a65c 100644 (file)
@@ -148,7 +148,9 @@ static int wkup_m3_rproc_probe(struct platform_device *pdev)
                return -ENODEV;
        }
 
-       pm_runtime_enable(&pdev->dev);
+       ret = devm_pm_runtime_enable(dev);
+       if (ret < 0)
+               return dev_err_probe(dev, ret, "Failed to enable runtime PM\n");
        ret = pm_runtime_get_sync(&pdev->dev);
        if (ret < 0) {
                dev_err(&pdev->dev, "pm_runtime_get_sync() failed\n");
@@ -219,7 +221,6 @@ err_put_rproc:
        rproc_free(rproc);
 err:
        pm_runtime_put_noidle(dev);
-       pm_runtime_disable(dev);
        return ret;
 }
 
@@ -230,7 +231,6 @@ static void wkup_m3_rproc_remove(struct platform_device *pdev)
        rproc_del(rproc);
        rproc_free(rproc);
        pm_runtime_put_sync(&pdev->dev);
-       pm_runtime_disable(&pdev->dev);
 }
 
 #ifdef CONFIG_PM