From: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
To: Bjorn Andersson <andersson@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>
Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org,
Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
Subject: [PATCH 5/5] remoteproc: ti_k3: Use devm_of_reserved_mem_device_init()
Date: Thu, 3 Sep 2026 01:03:18 +0530 [thread overview]
Message-ID: <20260902193318.1996827-6-mukesh.ojha@oss.qualcomm.com> (raw)
In-Reply-To: <20260902193318.1996827-1-mukesh.ojha@oss.qualcomm.com>
Replace the hand-rolled devm wrapper (k3_mem_release +
devm_add_action_or_reset) with the standard
devm_of_reserved_mem_device_init(), letting the device resource
manager handle cleanup automatically. Remove the now-unused k3_mem_release
exported symbol.
Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
---
drivers/remoteproc/ti_k3_common.c | 13 +------------
drivers/remoteproc/ti_k3_common.h | 1 -
2 files changed, 1 insertion(+), 13 deletions(-)
diff --git a/drivers/remoteproc/ti_k3_common.c b/drivers/remoteproc/ti_k3_common.c
index 3cb8ae5d72f6..f08b9e373220 100644
--- a/drivers/remoteproc/ti_k3_common.c
+++ b/drivers/remoteproc/ti_k3_common.c
@@ -458,14 +458,6 @@ int k3_rproc_of_get_memories(struct platform_device *pdev,
}
EXPORT_SYMBOL_GPL(k3_rproc_of_get_memories);
-void k3_mem_release(void *data)
-{
- struct device *dev = data;
-
- of_reserved_mem_device_release(dev);
-}
-EXPORT_SYMBOL_GPL(k3_mem_release);
-
int k3_reserved_mem_init(struct k3_rproc *kproc)
{
struct device *dev = kproc->dev;
@@ -486,14 +478,11 @@ int k3_reserved_mem_init(struct k3_rproc *kproc)
}
/* use reserved memory region 0 for vring DMA allocations */
- ret = of_reserved_mem_device_init_by_idx(dev, np, 0);
+ ret = devm_of_reserved_mem_device_init(dev);
if (ret) {
dev_err(dev, "device cannot initialize DMA pool (%d)\n", ret);
return ret;
}
- ret = devm_add_action_or_reset(dev, k3_mem_release, dev);
- if (ret)
- return ret;
num_rmems--;
kproc->rmem = devm_kcalloc(dev, num_rmems, sizeof(*kproc->rmem), GFP_KERNEL);
diff --git a/drivers/remoteproc/ti_k3_common.h b/drivers/remoteproc/ti_k3_common.h
index aee3c28dbe51..9a58aeb3867c 100644
--- a/drivers/remoteproc/ti_k3_common.h
+++ b/drivers/remoteproc/ti_k3_common.h
@@ -112,7 +112,6 @@ void *k3_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len,
bool *is_iomem);
int k3_rproc_of_get_memories(struct platform_device *pdev,
struct k3_rproc *kproc);
-void k3_mem_release(void *data);
int k3_reserved_mem_init(struct k3_rproc *kproc);
void k3_release_tsp(void *data);
#endif /* REMOTEPROC_TI_K3_COMMON_H */
--
2.55.0
prev parent reply other threads:[~2026-09-02 19:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 19:33 [PATCH 0/5] remoteproc: Use devm_of_reserved_mem_device_init() Mukesh Ojha
2026-09-02 19:33 ` [PATCH 1/5] remoteproc: da8xx: " Mukesh Ojha
2026-09-02 19:33 ` [PATCH 2/5] remoteproc: keystone: " Mukesh Ojha
2026-09-02 19:33 ` [PATCH 3/5] remoteproc: omap: " Mukesh Ojha
2026-09-02 19:33 ` [PATCH 4/5] remoteproc: mtk_scp: " Mukesh Ojha
2026-09-02 19:33 ` Mukesh Ojha [this message]
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=20260902193318.1996827-6-mukesh.ojha@oss.qualcomm.com \
--to=mukesh.ojha@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=matthias.bgg@gmail.com \
/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