From: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
To: Daniel Scally <dan.scally@ideasonboard.com>,
Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Eddie James <eajames@linux.ibm.com>,
Joel Stanley <joel@jms.id.au>,
Andrew Jeffery <andrew@codeconstruct.com.au>,
Minghsiu Tsai <minghsiu.tsai@mediatek.com>,
Houlong Wei <houlong.wei@mediatek.com>,
Andrew-CT Chen <andrew-ct.chen@mediatek.com>,
Tiffany Lin <tiffany.lin@mediatek.com>,
Yunfei Dong <yunfei.dong@mediatek.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Joseph Liu <kwliu@nuvoton.com>, Marvin Lin <kflin@nuvoton.com>,
Dmitry Osipenko <dmitry.osipenko@collabora.com>,
Maxime Ripard <mripard@kernel.org>,
Paul Kocialkowski <paulk@sys-base.io>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Chen-Yu Tsai <wens@kernel.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>
Cc: Ryan Chen <ryan_chen@aspeedtech.com>,
Billy Tsai <billy_tsai@aspeedtech.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
openbmc@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
linux-aspeed@lists.ozlabs.org,
linux-mediatek@lists.infradead.org, kernel@collabora.com,
linux-staging@lists.linux.dev, linux-sunxi@lists.linux.dev,
Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
Subject: [PATCH v2 6/6] staging: media: cedrus: Use devm_of_reserved_mem_device_init()
Date: Thu, 3 Sep 2026 01:37:03 +0530 [thread overview]
Message-ID: <20260902200703.2016410-7-mukesh.ojha@oss.qualcomm.com> (raw)
In-Reply-To: <20260902200703.2016410-1-mukesh.ojha@oss.qualcomm.com>
Use the devres-managed devm_of_reserved_mem_device_init() instead of
the manual of_reserved_mem_device_init()/of_reserved_mem_device_release()
pair, letting the device resource manager handle cleanup automatically.
Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
---
drivers/staging/media/sunxi/cedrus/cedrus_hw.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
index 444fb53878d1..4a15f45ad077 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
@@ -266,7 +266,7 @@ int cedrus_hw_probe(struct cedrus_dev *dev)
return ret;
}
- ret = of_reserved_mem_device_init(dev->dev);
+ ret = devm_of_reserved_mem_device_init(dev->dev);
if (ret && ret != -ENODEV) {
dev_err(dev->dev, "Failed to reserve memory\n");
@@ -277,7 +277,7 @@ int cedrus_hw_probe(struct cedrus_dev *dev)
if (ret) {
dev_err(dev->dev, "Failed to claim SRAM\n");
- goto err_mem;
+ return ret;
}
dev->ahb_clk = devm_clk_get(dev->dev, "ahb");
@@ -340,9 +340,6 @@ int cedrus_hw_probe(struct cedrus_dev *dev)
pm_runtime_disable(dev->dev);
err_sram:
sunxi_sram_release(dev->dev);
-err_mem:
- of_reserved_mem_device_release(dev->dev);
-
return ret;
}
@@ -353,6 +350,4 @@ void cedrus_hw_remove(struct cedrus_dev *dev)
cedrus_hw_suspend(dev->dev);
sunxi_sram_release(dev->dev);
-
- of_reserved_mem_device_release(dev->dev);
}
--
2.55.0
prev parent reply other threads:[~2026-09-02 20:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 20:06 [PATCH v2 0/6] media: Use devm_of_reserved_mem_device_init() Mukesh Ojha
2026-09-02 20:06 ` [PATCH v2 1/6] media: synopsys: hdmirx: " Mukesh Ojha
2026-09-02 20:06 ` [PATCH v2 2/6] media: aspeed: " Mukesh Ojha
2026-09-02 20:07 ` [PATCH v2 3/6] media: nuvoton: npcm-video: " Mukesh Ojha
2026-09-02 20:07 ` [PATCH v2 4/6] media: arm: mali-c55: " Mukesh Ojha
2026-09-02 20:07 ` [PATCH v2 5/6] media: mediatek: vpu: " Mukesh Ojha
2026-09-03 3:08 ` Chen-Yu Tsai
2026-09-02 20:07 ` 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=20260902200703.2016410-7-mukesh.ojha@oss.qualcomm.com \
--to=mukesh.ojha@oss.qualcomm.com \
--cc=andrew-ct.chen@mediatek.com \
--cc=andrew@codeconstruct.com.au \
--cc=angelogioacchino.delregno@collabora.com \
--cc=billy_tsai@aspeedtech.com \
--cc=dan.scally@ideasonboard.com \
--cc=dmitry.osipenko@collabora.com \
--cc=eajames@linux.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=houlong.wei@mediatek.com \
--cc=jacopo.mondi@ideasonboard.com \
--cc=jernej.skrabec@gmail.com \
--cc=joel@jms.id.au \
--cc=kernel@collabora.com \
--cc=kflin@nuvoton.com \
--cc=kwliu@nuvoton.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-staging@lists.linux.dev \
--cc=linux-sunxi@lists.linux.dev \
--cc=matthias.bgg@gmail.com \
--cc=mchehab@kernel.org \
--cc=minghsiu.tsai@mediatek.com \
--cc=mripard@kernel.org \
--cc=openbmc@lists.ozlabs.org \
--cc=paulk@sys-base.io \
--cc=ryan_chen@aspeedtech.com \
--cc=samuel@sholland.org \
--cc=tiffany.lin@mediatek.com \
--cc=wens@kernel.org \
--cc=yunfei.dong@mediatek.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