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 Mon, Mar 03, 2025 at 01:50:13PM +0200, Heikki Krogerus wrote:

...

> > +unsigned int device_get_child_node_count_named(const struct device *dev,
> > +					       const char *name)
> > +{
> > +	const struct fwnode_handle *fwnode = dev_fwnode(dev);
> > +
> > +	if (!fwnode)
> > +		return -EINVAL;
> > +
> > +	if (IS_ERR(fwnode))
> > +		return PTR_ERR(fwnode);
> > +
> > +	return fwnode_get_child_node_count_named(fwnode, name);
> > +}
> > +EXPORT_SYMBOL_GPL(device_get_child_node_count_named);
> 
> Sorry if I missed something in the v4 thread, but why not do all the
> checks in fwnode_get_child_node_count_named(), and make this an inline
> function?

+1, or drop the checks and make it return 0 depending on the follow up use cases.

>         static inline unsigned int
>         device_get_child_node_count_named(const struct device *dev, const char *name)
>         {
>                 return fwnode_get_child_node_count_named(dev_fwnode(fwnode), name);
>         }

-- 
With Best Regards,
Andy Shevchenko






[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