[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240802182300.244055-4-afd@ti.com>
Date: Fri, 2 Aug 2024 13:22:57 -0500
From: Andrew Davis <afd@...com>
To: Hari Nagalla <hnagalla@...com>, Bjorn Andersson <andersson@...nel.org>,
Mathieu Poirier <mathieu.poirier@...aro.org>
CC: <linux-remoteproc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
Andrew
Davis <afd@...com>
Subject: [PATCH 4/7] remoteproc: keystone: Use devm_pm_runtime_enable() helper
Use device life-cycle managed runtime enable function to simplify probe
and exit paths.
Signed-off-by: Andrew Davis <afd@...com>
---
drivers/remoteproc/keystone_remoteproc.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/remoteproc/keystone_remoteproc.c b/drivers/remoteproc/keystone_remoteproc.c
index 033e573544fef..f457cadc1fae0 100644
--- a/drivers/remoteproc/keystone_remoteproc.c
+++ b/drivers/remoteproc/keystone_remoteproc.c
@@ -410,12 +410,13 @@ static int keystone_rproc_probe(struct platform_device *pdev)
return PTR_ERR(ksproc->reset);
/* enable clock for accessing DSP internal memories */
- pm_runtime_enable(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_resume_and_get(dev);
- if (ret < 0) {
- dev_err(dev, "failed to enable clock, status = %d\n", ret);
- goto disable_rpm;
- }
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "failed to enable clock\n");
ret = keystone_rproc_of_get_memories(pdev, ksproc);
if (ret)
@@ -475,8 +476,6 @@ static int keystone_rproc_probe(struct platform_device *pdev)
gpiod_put(ksproc->kick_gpio);
disable_clk:
pm_runtime_put_sync(dev);
-disable_rpm:
- pm_runtime_disable(dev);
return ret;
}
@@ -487,7 +486,6 @@ static void keystone_rproc_remove(struct platform_device *pdev)
rproc_del(ksproc->rproc);
gpiod_put(ksproc->kick_gpio);
pm_runtime_put_sync(&pdev->dev);
- pm_runtime_disable(&pdev->dev);
}
static const struct of_device_id keystone_rproc_of_match[] = {
--
2.39.2
Powered by blists - more mailing lists