All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Kocialkowski <paulk@sys-base.io>
To: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
Cc: Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	Liviu Dudau <liviu.dudau@arm.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Joel Stanley <joel@jms.id.au>,
	Andrew Jeffery <andrew@codeconstruct.com.au>,
	Paul Cercueil <paul@crapouillou.net>,
	Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
	Linus Walleij <linusw@kernel.org>, Chen-Yu Tsai <wens@kernel.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Alexey Brodkin <abrodkin@synopsys.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
	Michal Simek <michal.simek@amd.com>,
	Daniel Scally <dan.scally@ideasonboard.com>,
	Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Eddie James <eajames@linux.ibm.com>,
	Tiffany Lin <tiffany.lin@mediatek.com>,
	Andrew-CT Chen <andrew-ct.chen@mediatek.com>,
	Yunfei Dong <yunfei.dong@mediatek.com>,
	Minghsiu Tsai <minghsiu.tsai@mediatek.com>,
	Houlong Wei <houlong.wei@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>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Thierry Reding <thierry.reding@kernel.org>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Srinivas Kandagatla <srini@kernel.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ge Gordon <gordon.ge@bst.ai>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Ulf Hansson <ulfh@kernel.org>, Rob Herring <robh@kernel.org>,
	Saravana Kannan <saravanak@kernel.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Shengjiu Wang <shengjiu.wang@gmail.com>,
	Xiubo Li <Xiubo.Lee@gmail.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Frank Li <Frank.Li@nxp.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Peter Ujfalusi <peter.ujfalusi@linux.intel.com>,
	Bard Liao <yung-chuan.liao@linux.intel.com>,
	Daniel Baluta <daniel.baluta@nxp.com>,
	Orson Zhai <orsonzhai@gmail.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Peter Chen <peter.chen@cixtech.com>,
	Fugang Duan <fugang.duan@cixtech.com>,
	Ekansh Gupta <ekansh.gupta@oss.qualcomm.com>,
	BST Linux Kernel Upstream Group <bst-upstream@bstai.top>,
	Fabio Estevam <festevam@gmail.com>,
	Nicolin Chen <nicoleotsuka@gmail.com>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
	Vijendar Mukunda <Vijendar.Mukunda@amd.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	CIX Linux Kernel Upstream Group <cix-kernel-upstream@cixtech.com>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-aspeed@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org,
	linux-sunxi@lists.linux.dev, linux-media@vger.kernel.org,
	openbmc@lists.ozlabs.org, linux-mediatek@lists.infradead.org,
	kernel@collabora.com, linux-tegra@vger.kernel.org,
	linux-mmc@vger.kernel.org, devicetree@vger.kernel.org,
	linux-remoteproc@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-sound@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	imx@lists.linux.dev, sound-open-firmware@alsa-project.org
Subject: Re: [PATCH 30/42] staging: media: cedrus: Use devm_of_reserved_mem_device_init()
Date: Tue, 7 Jul 2026 16:05:19 +0200	[thread overview]
Message-ID: <ak0HnzMzGT_WZ9u1@shepard> (raw)
In-Reply-To: <20260703193855.110619-31-mukesh.ojha@oss.qualcomm.com>

[-- Attachment #1: Type: text/plain, Size: 1831 bytes --]

Hi Mukesh,

On Sat 04 Jul 26, 01:08, Mukesh Ojha wrote:
> 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.

Thanks for your work!

> Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
> ---
>  drivers/staging/media/sunxi/cedrus/cedrus_hw.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
> index 444fb53878d1..7b5aa94064a1 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");
>  
> @@ -341,8 +341,6 @@ int cedrus_hw_probe(struct cedrus_dev *dev)
>  err_sram:
>  	sunxi_sram_release(dev->dev);
>  err_mem:

Could you also remove this label and switch the goto user to a regular
return ret?

Thanks!

All the best,

Paul

> -	of_reserved_mem_device_release(dev->dev);
> -
>  	return ret;
>  }
>  
> @@ -353,6 +351,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.53.0
> 

-- 
Paul Kocialkowski,

Independent contractor - sys-base - https://www.sys-base.io/
Free software developer - https://www.paulk.fr/

Expert in multimedia, graphics and embedded hardware support with Linux.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-07-07 14:06 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-03 19:38 [PATCH 00/42] of: reserved_mem: Introduce devres helpers and convert drivers Mukesh Ojha
2026-07-03 19:38 ` [PATCH 01/42] of: reserved_mem: Introduce devres-managed initialization functions Mukesh Ojha
2026-07-03 19:38 ` [PATCH 02/42] of: reserved_mem: Add devm_of_reserved_mem_device_init_by_name() Mukesh Ojha
2026-07-03 19:38 ` [PATCH 03/42] firmware: qcom: scm: Use devm_of_reserved_mem_device_init() Mukesh Ojha
2026-07-03 23:12   ` Dmitry Baryshkov
2026-07-06  8:32   ` Konrad Dybcio
2026-07-03 19:38 ` [PATCH 04/42] remoteproc: da8xx: " Mukesh Ojha
2026-07-03 19:38 ` [PATCH 05/42] remoteproc: keystone: " Mukesh Ojha
2026-07-03 19:38 ` [PATCH 06/42] media: synopsys: hdmirx: " Mukesh Ojha
2026-07-06 15:00   ` Dmitry Osipenko
2026-07-03 19:38 ` [PATCH 07/42] remoteproc: omap: " Mukesh Ojha
2026-07-03 19:38 ` [PATCH 08/42] drm: logicvc: " Mukesh Ojha
2026-07-07 14:10   ` Paul Kocialkowski
2026-07-03 19:38 ` [PATCH 09/42] drm: hdlcd: " Mukesh Ojha
2026-07-03 19:38 ` [PATCH 10/42] drm: pl111: " Mukesh Ojha
2026-07-10 17:45   ` Linus Walleij
2026-07-03 19:38 ` [PATCH 11/42] remoteproc: mtk_scp: " Mukesh Ojha
2026-07-03 19:38 ` [PATCH 12/42] media: aspeed: " Mukesh Ojha
2026-07-03 19:38 ` [PATCH 13/42] media: nuvoton: npcm-video: " Mukesh Ojha
2026-07-03 19:38 ` [PATCH 14/42] memory: tegra210-emc: Use devm_of_reserved_mem_device_init_by_name() Mukesh Ojha
2026-07-03 19:38 ` [PATCH 15/42] drm: komeda: Use devm_of_reserved_mem_device_init() Mukesh Ojha
2026-07-03 19:38 ` [PATCH 16/42] drm: malidp: " Mukesh Ojha
2026-07-03 19:38 ` [PATCH 17/42] drm: ingenic: " Mukesh Ojha
2026-07-07 18:06   ` Paul Cercueil
2026-07-03 19:38 ` [PATCH 18/42] drm: kmb: " Mukesh Ojha
2026-07-03 19:38 ` [PATCH 19/42] drm: sun4i: " Mukesh Ojha
2026-07-03 19:38 ` [PATCH 20/42] drm: xlnx: zynqmp_dpsub: " Mukesh Ojha
2026-07-07  9:13   ` Pandey, Radhey Shyam
2026-07-03 19:38 ` [PATCH 21/42] media: arm: mali-c55: " Mukesh Ojha
2026-07-03 19:38 ` [PATCH 22/42] media: mediatek: vpu: " Mukesh Ojha
2026-07-03 19:38 ` [PATCH 23/42] mmc: sdhci-of-bst: Use devm_of_reserved_mem_device_init_by_idx() Mukesh Ojha
2026-07-10 13:08   ` Ulf Hansson
2026-07-03 19:38 ` [PATCH 24/42] remoteproc: ti_k3: Use devm_of_reserved_mem_device_init() Mukesh Ojha
2026-07-03 19:38 ` [PATCH 25/42] ASoC: mediatek: mt8192: " Mukesh Ojha
2026-07-06 12:16   ` Mark Brown
2026-07-03 19:38 ` [PATCH 26/42] ASoC: mediatek: mt8196: " Mukesh Ojha
2026-07-06 12:16   ` Mark Brown
2026-07-03 19:38 ` [PATCH 27/42] ASoC: mediatek: mt8183: " Mukesh Ojha
2026-07-06 12:17   ` Mark Brown
2026-07-03 19:38 ` [PATCH 28/42] ASoC: mediatek: mt8189: " Mukesh Ojha
2026-07-06 12:18   ` Mark Brown
2026-07-03 19:38 ` [PATCH 29/42] ASoC: SOF: imx: Use devm_of_reserved_mem_device_init_by_name() Mukesh Ojha
2026-07-06 12:19   ` Mark Brown
2026-07-03 19:38 ` [PATCH 30/42] staging: media: cedrus: Use devm_of_reserved_mem_device_init() Mukesh Ojha
2026-07-07 14:05   ` Paul Kocialkowski [this message]
2026-07-03 19:38 ` [PATCH 31/42] ASoC: cix-ipbloq: " Mukesh Ojha
2026-07-06 12:20   ` Mark Brown
2026-07-07  1:34   ` Gary Yang
2026-07-03 19:38 ` [PATCH 32/42] drm: aspeed: " Mukesh Ojha
2026-07-05 19:40 ` [PATCH 33/42] drm: arcpgu: " Mukesh Ojha
2026-07-05 19:40 ` [PATCH 34/42] ASoC: mediatek: mt8173: " Mukesh Ojha
2026-07-05 19:40 ` [PATCH 35/42] ASoC: mediatek: mt8186: " Mukesh Ojha
2026-07-05 19:40 ` [PATCH 36/42] ASoC: mediatek: mt8188: " Mukesh Ojha
2026-07-05 19:40 ` [PATCH 37/42] ASoC: mediatek: mt8195: " Mukesh Ojha
2026-07-05 19:40 ` [PATCH 38/42] ASoC: SOF: mediatek: mt8186: " Mukesh Ojha
2026-07-05 19:40 ` [PATCH 39/42] ASoC: SOF: mediatek: mt8195: " Mukesh Ojha
2026-07-05 19:40 ` [PATCH 40/42] misc: fastrpc: " Mukesh Ojha
2026-07-06  4:55   ` Ekansh Gupta
2026-07-05 19:40 ` [PATCH 41/42] ASoC: fsl: imx-rpmsg: Use devm_of_reserved_mem_device_init_by_idx() Mukesh Ojha
2026-07-05 19:40 ` [PATCH 42/42] ASoC: sprd: Use devm_of_reserved_mem_device_init() Mukesh Ojha
2026-07-06 12:14 ` [PATCH 00/42] of: reserved_mem: Introduce devres helpers and convert drivers Mark Brown
2026-07-06 13:16   ` Mukesh Ojha
2026-07-07 11:39 ` Liviu Dudau

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=ak0HnzMzGT_WZ9u1@shepard \
    --to=paulk@sys-base.io \
    --cc=Frank.Li@nxp.com \
    --cc=Vijendar.Mukunda@amd.com \
    --cc=Xiubo.Lee@gmail.com \
    --cc=abrodkin@synopsys.com \
    --cc=adrian.hunter@intel.com \
    --cc=airlied@gmail.com \
    --cc=andersson@kernel.org \
    --cc=andrew-ct.chen@mediatek.com \
    --cc=andrew@codeconstruct.com.au \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=anitha.chrisanthus@intel.com \
    --cc=arnd@arndb.de \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=broonie@kernel.org \
    --cc=bst-upstream@bstai.top \
    --cc=cix-kernel-upstream@cixtech.com \
    --cc=dan.scally@ideasonboard.com \
    --cc=daniel.baluta@nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.osipenko@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eajames@linux.ibm.com \
    --cc=ekansh.gupta@oss.qualcomm.com \
    --cc=festevam@gmail.com \
    --cc=fugang.duan@cixtech.com \
    --cc=gordon.ge@bst.ai \
    --cc=gregkh@linuxfoundation.org \
    --cc=houlong.wei@mediatek.com \
    --cc=imx@lists.linux.dev \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=joel@jms.id.au \
    --cc=jonathanh@nvidia.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=kernel@collabora.com \
    --cc=kernel@pengutronix.de \
    --cc=kflin@nuvoton.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk@kernel.org \
    --cc=kwliu@nuvoton.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=lgirdwood@gmail.com \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.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-mips@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=liviu.dudau@arm.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=michal.simek@amd.com \
    --cc=minghsiu.tsai@mediatek.com \
    --cc=mripard@kernel.org \
    --cc=mukesh.ojha@oss.qualcomm.com \
    --cc=nicoleotsuka@gmail.com \
    --cc=openbmc@lists.ozlabs.org \
    --cc=orsonzhai@gmail.com \
    --cc=paul@crapouillou.net \
    --cc=perex@perex.cz \
    --cc=peter.chen@cixtech.com \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=samuel@sholland.org \
    --cc=saravanak@kernel.org \
    --cc=shengjiu.wang@gmail.com \
    --cc=simona@ffwll.ch \
    --cc=sound-open-firmware@alsa-project.org \
    --cc=srini@kernel.org \
    --cc=thierry.reding@kernel.org \
    --cc=tiffany.lin@mediatek.com \
    --cc=tiwai@suse.com \
    --cc=tomi.valkeinen@ideasonboard.com \
    --cc=tzimmermann@suse.de \
    --cc=ulfh@kernel.org \
    --cc=wens@kernel.org \
    --cc=yunfei.dong@mediatek.com \
    --cc=yung-chuan.liao@linux.intel.com \
    --cc=zhang.lyra@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.