[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <39cbe817-fef4-405c-b30c-79b592c0bcfe@gmail.com>
Date: Mon, 10 Mar 2025 08:23:15 +0200
From: Matti Vaittinen <mazziesaccount@...il.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>,
Jonathan Cameron <jic23@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
<conor+dt@...nel.org>, Daniel Scally <djrscally@...il.com>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>, Danilo Krummrich <dakr@...nel.org>,
Claudiu Manoil <claudiu.manoil@....com>, Andrew Lunn
<andrew+netdev@...n.ch>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-acpi@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH v5 02/10] property: Add functions to count named child
nodes
On 03/03/2025 13:59, Andy Shevchenko wrote:
> On Mon, Mar 03, 2025 at 01:31:45PM +0200, Matti Vaittinen wrote:
...
>
>> + return count;
>> +}
>
>> + if (!fwnode)
>> + return -EINVAL;
>> +
>> + if (IS_ERR(fwnode))
>> + return PTR_ERR(fwnode);
>
> I expect that this will return 0 or number of nodes. Why do we need an error code?
> If it's really required, it should be in the fwnode API above.
>
> Also do we care about secondary fwnodes?
We have the device_get_child_node_count().
device_get_child_node_count_named() should follow the same logic.
>
>> + return fwnode_get_child_node_count_named(fwnode, name);
>> +}
>
> ...
>
>> +unsigned int fwnode_get_child_node_count_named(const struct fwnode_handle *fwnode,
>> + const char *name);
>
> To me the following name sounds better: fwnode_get_named_child_node_count().
Agree.
>
>> +unsigned int device_get_child_node_count_named(const struct device *dev,
>> + const char *name);
>
> In the similar way.
>
Powered by blists - more mailing lists