public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Davis <afd@ti.com>
To: Bjorn Andersson <andersson@kernel.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: <linux-remoteproc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, Andrew Davis <afd@ti.com>
Subject: [PATCH 4/4] remoteproc: wkup_m3: Use devm_rproc_add() helper
Date: Mon, 2 Dec 2024 16:19:04 -0600	[thread overview]
Message-ID: <20241202221904.319149-4-afd@ti.com> (raw)
In-Reply-To: <20241202221904.319149-1-afd@ti.com>

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>
---
 drivers/remoteproc/wkup_m3_rproc.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/remoteproc/wkup_m3_rproc.c b/drivers/remoteproc/wkup_m3_rproc.c
index 30e9ecd75657f..6af9aa4179d0c 100644
--- a/drivers/remoteproc/wkup_m3_rproc.c
+++ b/drivers/remoteproc/wkup_m3_rproc.c
@@ -208,22 +208,13 @@ static int wkup_m3_rproc_probe(struct platform_device *pdev)
 		wkupm3->mem[i].dev_addr = be32_to_cpu(*addrp) - l4_offset;
 	}
 
-	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 +233,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,
-- 
2.39.2


  parent reply	other threads:[~2024-12-02 22:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Andrew Davis [this message]
  -- 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241202221904.319149-4-afd@ti.com \
    --to=afd@ti.com \
    --cc=andersson@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox