From: Matti Vaittinen <mazziesaccount@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>,
Jonathan Cameron <jic23@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Daniel Scally <djrscally@gmail.com>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Danilo Krummrich <dakr@kernel.org>,
Claudiu Manoil <claudiu.manoil@nxp.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
netdev@vger.kernel.org
Subject: Re: [PATCH v5 02/10] property: Add functions to count named child nodes
Date: Mon, 10 Mar 2025 08:23:15 +0200 [thread overview]
Message-ID: <39cbe817-fef4-405c-b30c-79b592c0bcfe@gmail.com> (raw)
In-Reply-To: <Z8WZh5EzFqxvU5rb@smile.fi.intel.com>
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.
>
next prev parent reply other threads:[~2025-03-10 6:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-03 11:30 [PATCH v5 00/10] Support ROHM BD79124 ADC Matti Vaittinen
2025-03-03 11:31 ` [PATCH v5 01/10] dt-bindings: ROHM BD79124 ADC/GPO Matti Vaittinen
2025-03-03 11:31 ` [PATCH v5 02/10] property: Add functions to count named child nodes Matti Vaittinen
2025-03-03 11:50 ` Heikki Krogerus
2025-03-03 12:00 ` Andy Shevchenko
2025-03-03 11:59 ` Andy Shevchenko
2025-03-10 6:23 ` Matti Vaittinen [this message]
2025-03-10 8:23 ` Andy Shevchenko
2025-03-03 11:32 ` [PATCH v5 03/10] iio: adc: add helpers for parsing ADC nodes Matti Vaittinen
2025-03-04 9:25 ` David Lechner
2025-03-04 12:07 ` Andy Shevchenko
2025-03-05 10:54 ` Matti Vaittinen
2025-03-08 16:29 ` Jonathan Cameron
2025-03-10 7:41 ` Matti Vaittinen
2025-03-10 19:25 ` Jonathan Cameron
2025-03-03 11:34 ` [PATCH v5 08/10] MAINTAINERS: Add IIO ADC helpers Matti Vaittinen
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=39cbe817-fef4-405c-b30c-79b592c0bcfe@gmail.com \
--to=mazziesaccount@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=andriy.shevchenko@linux.intel.com \
--cc=claudiu.manoil@nxp.com \
--cc=conor+dt@kernel.org \
--cc=dakr@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=djrscally@gmail.com \
--cc=edumazet@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matti.vaittinen@fi.rohmeurope.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=sakari.ailus@linux.intel.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 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).