Re: [PATCH v5 02/10] property: Add functions to count named child nodes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.






[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux