From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EB5C3C44514 for ; Thu, 16 Jul 2026 20:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SkbdCLvPFiAZcCyqV3OjTuTi5o9qsDoHdIygT4AGL4s=; b=NpWGmT1Vr6cStcQvxD3mBhhWuQ l2XV/qH10TuowbifwBXFwCOBhgm9odPkeGVHSoOOHm7Upz91Un89zgfUGdvX9gbKztFiF2lbMc41m Wc9nlLW43VuKPQebinXSVZo6xUoDpLn548cFE3wrlDui27C+wlZxnvBEu5rnA0fr+wstx173uIBUR CTsZXat40KK9uQLwZMMi0eHww7XwUWmsOsh+7a3II397wtnpSAYHAl+7odbm7vp+cOWLyLX1w+r0F 4wFfew+4jhG3hfdTWJJQLzbK0QoUJgPh9dAIVUhfXwL9/A2nl11tnRigmhHnMMu5UiVb/fnKvcMc9 AdUoeYOA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wkSGK-00000000UgF-29WZ; Thu, 16 Jul 2026 20:00:52 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wkSGJ-00000000Ug4-0phc; Thu, 16 Jul 2026 20:00:51 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 8C69460A5E; Thu, 16 Jul 2026 20:00:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B5241F000E9; Thu, 16 Jul 2026 20:00:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784232049; bh=SkbdCLvPFiAZcCyqV3OjTuTi5o9qsDoHdIygT4AGL4s=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=a5qGtpAkwNEV9jsxYeN/Q7n89zdNsN11G1zMfSI/etA7Yi8LAH8wgTwX8UoL8G6L3 QtafStp+dmSt5fFR0M7Ai+HhZRfgGrSBdmRSVU1fjHDIuAp1dKdasuz9jt0aJrxD3/ m0tYK1IMkzPighZh3SmtIb3LTdl0mWbQQGJdURYx9sNiNa31kAqFcPx603ZWrA8Z5J JfUlu+YJIGtuoeaFb2374D//LRjheitSmsxEZ9JXEZaPg3WYZES56yqM6EQ9jdxYlv mgAQgo5RIr1XNkCB+v1k0eQV6pruyKIOj7Rs+S8wE73+oNZNKsm6QaBr6/beqAO5pH tJpkEALlcnrlg== Date: Thu, 16 Jul 2026 15:00:48 -0500 From: Rob Herring To: Mukesh Ojha Cc: Bjorn Andersson , Konrad Dybcio , Liviu Dudau , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Joel Stanley , Andrew Jeffery , Paul Cercueil , Anitha Chrisanthus , Paul Kocialkowski , Linus Walleij , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Alexey Brodkin , Laurent Pinchart , Tomi Valkeinen , Michal Simek , Daniel Scally , Jacopo Mondi , Mauro Carvalho Chehab , Eddie James , Tiffany Lin , Andrew-CT Chen , Yunfei Dong , Minghsiu Tsai , Houlong Wei , Matthias Brugger , AngeloGioacchino Del Regno , Joseph Liu , Marvin Lin , Dmitry Osipenko , Krzysztof Kozlowski , Thierry Reding , Jonathan Hunter , Srinivas Kandagatla , Arnd Bergmann , Greg Kroah-Hartman , Ge Gordon , Adrian Hunter , Ulf Hansson , Saravana Kannan , Mathieu Poirier , Jaroslav Kysela , Takashi Iwai , Shengjiu Wang , Xiubo Li , Liam Girdwood , Mark Brown , Frank Li , Sascha Hauer , Peter Ujfalusi , Bard Liao , Daniel Baluta , Orson Zhai , Baolin Wang , Peter Chen , Fugang Duan , Ekansh Gupta , BST Linux Kernel Upstream Group , Fabio Estevam , Nicolin Chen , Pengutronix Kernel Team , Kai Vehmanen , Pierre-Louis Bossart , Vijendar Mukunda , Chunyan Zhang , CIX Linux Kernel Upstream Group , 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, Konrad Dybcio Subject: Re: [PATCH 01/42] of: reserved_mem: Introduce devres-managed initialization functions Message-ID: <20260716200048.GA1183026-robh@kernel.org> References: <20260703193855.110619-1-mukesh.ojha@oss.qualcomm.com> <20260703193855.110619-2-mukesh.ojha@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260703193855.110619-2-mukesh.ojha@oss.qualcomm.com> X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Sat, Jul 04, 2026 at 01:08:14AM +0530, Mukesh Ojha wrote: > From: Konrad Dybcio > > Introduce devres-based helpers for of_reserved_mem_device_init(_by_idx) > to help fight dangling references and ever so slightly reduce the > number of boilerplate deinitialization calls. > > Signed-off-by: Konrad Dybcio > Signed-off-by: Mukesh Ojha > --- > drivers/of/of_reserved_mem.c | 41 +++++++++++++++++++++++++++++++++ > include/linux/of_reserved_mem.h | 25 ++++++++++++++++++++ > 2 files changed, 66 insertions(+) > > diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c > index 82222bd45ac6..b35541e9fbe8 100644 > --- a/drivers/of/of_reserved_mem.c > +++ b/drivers/of/of_reserved_mem.c > @@ -787,6 +787,47 @@ void of_reserved_mem_device_release(struct device *dev) > } > EXPORT_SYMBOL_GPL(of_reserved_mem_device_release); > > +static void devm_of_reserved_mem_device_release(struct device *dev, void *res) > +{ > + of_reserved_mem_device_release(*(struct device **)res); > +} > + > +/** > + * devm_of_reserved_mem_device_init_by_idx() - Resource managed of_reserved_mem_device_init_by_idx() > + * @dev: Pointer to the device to configure > + * @np: Pointer to the device node with 'memory-region' property > + * @idx: Index of selected region > + * > + * This is a resource managed version of of_reserved_mem_device_init_by_idx(). > + * The reserved memory region will be released automatically when the device > + * is unbound. > + * > + * Returns: Negative errno on failure or zero on success. > + */ > +int devm_of_reserved_mem_device_init_by_idx(struct device *dev, > + struct device_node *np, int idx) It looks to me like the only 2? users of this could be converted to devm_of_reserved_mem_device_init() instead. The mmc one obviously can. The imx one depends if np is dev->of_node. I'm not a fan of APIs with only a few users. Rob