Linux Remote Processor Subsystem development
 help / color / mirror / Atom feed
* [PATCH 1/4] remoteproc: wkup_m3: Use devm_pm_runtime_enable() helper
@ 2024-12-02 22:19 Andrew Davis
  2024-12-02 22:19 ` [PATCH 2/4] remoteproc: wkup_m3: Use devm action to call PM runtime put sync Andrew Davis
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andrew Davis @ 2024-12-02 22:19 UTC (permalink / raw)
  To: Bjorn Andersson, Mathieu Poirier
  Cc: linux-remoteproc, linux-kernel, Andrew Davis

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

Signed-off-by: Andrew Davis <afd@ti.com>
---
 drivers/remoteproc/wkup_m3_rproc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/remoteproc/wkup_m3_rproc.c b/drivers/remoteproc/wkup_m3_rproc.c
index d8be21e717212..35c2145b12db7 100644
--- a/drivers/remoteproc/wkup_m3_rproc.c
+++ b/drivers/remoteproc/wkup_m3_rproc.c
@@ -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 @@ static int wkup_m3_rproc_probe(struct platform_device *pdev)
 	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
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH 1/4] remoteproc: wkup_m3: Use devm_pm_runtime_enable() helper
@ 2025-08-14 15:39 Andrew Davis
  2025-08-14 15:39 ` [PATCH 4/4] remoteproc: wkup_m3: Use devm_rproc_add() helper Andrew Davis
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Davis @ 2025-08-14 15:39 UTC (permalink / raw)
  To: Bjorn Andersson, Mathieu Poirier, Hari Nagalla, Beleswar Padhi
  Cc: linux-remoteproc, linux-kernel, Andrew Davis

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

Signed-off-by: Andrew Davis <afd@ti.com>
---
 drivers/remoteproc/wkup_m3_rproc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/remoteproc/wkup_m3_rproc.c b/drivers/remoteproc/wkup_m3_rproc.c
index d8be21e717212..35c2145b12db7 100644
--- a/drivers/remoteproc/wkup_m3_rproc.c
+++ b/drivers/remoteproc/wkup_m3_rproc.c
@@ -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 @@ static int wkup_m3_rproc_probe(struct platform_device *pdev)
 	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
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-08-14 15:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-02 22:19 [PATCH 1/4] remoteproc: wkup_m3: Use devm_pm_runtime_enable() helper Andrew Davis
2024-12-02 22:19 ` [PATCH 2/4] remoteproc: wkup_m3: Use devm action to call PM runtime put sync Andrew Davis
2024-12-02 22:19 ` [PATCH 3/4] remoteproc: wkup_m3: Use devm_rproc_alloc() helper Andrew Davis
2024-12-02 22:19 ` [PATCH 4/4] remoteproc: wkup_m3: Use devm_rproc_add() helper Andrew Davis
  -- strict thread matches above, loose matches on Subject: below --
2025-08-14 15:39 [PATCH 1/4] remoteproc: wkup_m3: Use devm_pm_runtime_enable() helper Andrew Davis
2025-08-14 15:39 ` [PATCH 4/4] remoteproc: wkup_m3: Use devm_rproc_add() helper Andrew Davis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox