[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b32b9698-0254-43b3-8109-ee8e37482bae@kernel.org>
Date: Wed, 30 Jul 2025 11:46:46 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Viresh Kumar <viresh.kumar@...aro.org>, linux-kernel@...r.kernel.org,
Rob Herring <robh@...nel.org>, Saravana Kannan <saravanak@...gle.com>
Cc: Arnd Bergmann <arnd@...nel.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
Alex Bennée <alex.bennee@...aro.org>,
Bill Mills <bill.mills@...aro.org>, "Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>, devicetree@...r.kernel.org,
virtualization@...ts.linux.dev, Sudeep Holla <sudeep.holla@....com>,
Bertrand Marquis <bertrand.marquis@....com>,
"Edgar E . Iglesias" <edgar.iglesias@....com>,
Arnaud Pouliquen <arnaud.pouliquen@...s.st.com>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>
Subject: Re: [RFC PATCH 2/6] of: reserved-memory: Add
of_reserved_mem_lookup_by_name
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
Powered by blists - more mailing lists