From: Krzysztof Kozlowski <krzk@kernel.org>
To: Viresh Kumar <viresh.kumar@linaro.org>,
linux-kernel@vger.kernel.org, Rob Herring <robh@kernel.org>,
Saravana Kannan <saravanak@google.com>
Cc: "Arnd Bergmann" <arnd@kernel.org>,
"Vincent Guittot" <vincent.guittot@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Bill Mills" <bill.mills@linaro.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
devicetree@vger.kernel.org, virtualization@lists.linux.dev,
"Sudeep Holla" <sudeep.holla@arm.com>,
"Bertrand Marquis" <bertrand.marquis@arm.com>,
"Edgar E . Iglesias" <edgar.iglesias@amd.com>,
"Arnaud Pouliquen" <arnaud.pouliquen@foss.st.com>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>
Subject: Re: [RFC PATCH 2/6] of: reserved-memory: Add of_reserved_mem_lookup_by_name
Date: Wed, 30 Jul 2025 11:46:46 +0200 [thread overview]
Message-ID: <b32b9698-0254-43b3-8109-ee8e37482bae@kernel.org> (raw)
In-Reply-To: <feb4591cc48c70f9790c3f4d37c149fc336c3110.1753865268.git.viresh.kumar@linaro.org>
On 30/07/2025 11:29, Viresh Kumar wrote:
> This adds of_reserved_mem_lookup_by_name() helper to get a
Add...
>
> +/**
> + * of_reserved_mem_lookup_by_name() - acquire reserved_mem from node name
> + * @name: node name
> + *
> + * This function allows drivers to acquire a reference to the reserved_mem
> + * struct based on a reserved-memory node name.
> + *
> + * Returns a reserved_mem reference, or NULL on error.
> + */
> +struct reserved_mem *of_reserved_mem_lookup_by_name(const char *name)
> +{
> + struct device_node *np __free(device_node) =
> + of_find_node_by_path("/reserved-memory");
> + struct device_node *child __free(device_node) = NULL;
This should not be NULL or this should not be cleanup. Follow coding
style for cleanup - constructor must be real here. You probably wanted
scoped loop below.
> +
> + if (!np)
> + return ERR_PTR(-ENODEV);
> +
> + for_each_child_of_node(np, child) {
Best regards,
Krzysztof
next prev parent reply other threads:[~2025-07-30 9:46 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-30 9:29 [RFC PATCH 0/6] virtio: Add support for Virtio message transport Viresh Kumar
2025-07-30 9:29 ` [RFC PATCH 1/6] of: reserved-memory: Add reserved_mem_device_init() Viresh Kumar
2025-07-30 9:29 ` [RFC PATCH 2/6] of: reserved-memory: Add of_reserved_mem_lookup_by_name Viresh Kumar
2025-07-30 9:46 ` Krzysztof Kozlowski [this message]
2025-07-30 10:57 ` Viresh Kumar
2025-07-30 11:24 ` Krzysztof Kozlowski
2025-08-01 6:02 ` Viresh Kumar
2025-07-30 9:29 ` [RFC PATCH 3/6] virtio: Add support for virtio-msg transport Viresh Kumar
2025-07-30 9:29 ` [RFC PATCH 4/6] virtio-msg: Add optional userspace interface for message I/O Viresh Kumar
2025-07-30 9:29 ` [RFC PATCH 5/6] virtio-msg: Add support for FF-A (Firmware Framework for Arm) bus Viresh Kumar
2025-07-30 9:29 ` [RFC PATCH 6/6] virtio-msg: Add support for loopback bus Viresh Kumar
2025-07-30 9:49 ` Krzysztof Kozlowski
2025-07-30 13:39 ` [RFC PATCH 0/6] virtio: Add support for Virtio message transport Rob Herring
2025-08-12 9:49 ` Viresh Kumar
2025-08-12 13:28 ` Rob Herring
2025-08-13 6:28 ` Viresh Kumar
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=b32b9698-0254-43b3-8109-ee8e37482bae@kernel.org \
--to=krzk@kernel.org \
--cc=alex.bennee@linaro.org \
--cc=arnaud.pouliquen@foss.st.com \
--cc=arnd@kernel.org \
--cc=bertrand.marquis@arm.com \
--cc=bill.mills@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=edgar.iglesias@amd.com \
--cc=jasowang@redhat.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=robh@kernel.org \
--cc=saravanak@google.com \
--cc=sudeep.holla@arm.com \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
--cc=virtualization@lists.linux.dev \
/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;
as well as URLs for NNTP newsgroup(s).