From: Andrew Davis <afd@ti.com>
To: Bjorn Andersson <andersson@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
Hari Nagalla <hnagalla@ti.com>, Beleswar Padhi <b-padhi@ti.com>
Cc: <linux-remoteproc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, Andrew Davis <afd@ti.com>
Subject: [PATCH 3/3] remoteproc: da8xx: Use devm_rproc_add() helper
Date: Thu, 14 Aug 2025 08:55:32 -0500 [thread overview]
Message-ID: <20250814135532.638040-3-afd@ti.com> (raw)
In-Reply-To: <20250814135532.638040-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.
As this now makes the IRQ free ordered correctly, we can drop that from
the remove() callback, which is now empty and can also be removed.
Signed-off-by: Andrew Davis <afd@ti.com>
---
drivers/remoteproc/da8xx_remoteproc.c | 20 +-------------------
1 file changed, 1 insertion(+), 19 deletions(-)
diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c
index 58b4f05283d92..e418a2bf5d2ee 100644
--- a/drivers/remoteproc/da8xx_remoteproc.c
+++ b/drivers/remoteproc/da8xx_remoteproc.c
@@ -302,8 +302,6 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
if (ret)
return ret;
- platform_set_drvdata(pdev, rproc);
-
/* everything the ISR needs is now setup, so hook it up */
ret = devm_request_threaded_irq(dev, irq, da8xx_rproc_callback,
handle_event, 0, "da8xx-remoteproc",
@@ -328,7 +326,7 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
drproc->irq_data = irq_data;
drproc->irq = irq;
- ret = rproc_add(rproc);
+ ret = devm_rproc_add(dev, rproc);
if (ret) {
dev_err(dev, "rproc_add failed: %d\n", ret);
return ret;
@@ -337,21 +335,6 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
return 0;
}
-static void da8xx_rproc_remove(struct platform_device *pdev)
-{
- struct rproc *rproc = platform_get_drvdata(pdev);
- struct da8xx_rproc *drproc = rproc->priv;
-
- /*
- * The devm subsystem might end up releasing things before
- * freeing the irq, thus allowing an interrupt to sneak in while
- * the device is being removed. This should prevent that.
- */
- disable_irq(drproc->irq);
-
- rproc_del(rproc);
-}
-
static const struct of_device_id davinci_rproc_of_match[] __maybe_unused = {
{ .compatible = "ti,da850-dsp", },
{ /* sentinel */ },
@@ -360,7 +343,6 @@ MODULE_DEVICE_TABLE(of, davinci_rproc_of_match);
static struct platform_driver da8xx_rproc_driver = {
.probe = da8xx_rproc_probe,
- .remove = da8xx_rproc_remove,
.driver = {
.name = "davinci-rproc",
.of_match_table = of_match_ptr(davinci_rproc_of_match),
--
2.39.2
next prev parent reply other threads:[~2025-08-14 13:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-14 13:55 [PATCH 1/3] remoteproc: da8xx: Use devm_rproc_alloc() helper Andrew Davis
2025-08-14 13:55 ` [PATCH 2/3] remoteproc: da8xx: Use devm action to release reserved memory Andrew Davis
2025-08-25 17:04 ` Mathieu Poirier
2025-08-25 18:29 ` Andrew Davis
2025-08-26 18:48 ` Mathieu Poirier
2025-08-14 13:55 ` Andrew Davis [this message]
2025-08-25 17:01 ` [PATCH 1/3] remoteproc: da8xx: Use devm_rproc_alloc() helper Mathieu Poirier
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=20250814135532.638040-3-afd@ti.com \
--to=afd@ti.com \
--cc=andersson@kernel.org \
--cc=b-padhi@ti.com \
--cc=hnagalla@ti.com \
--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