On Mon, Sep 11, 2017 at 03:34:16PM +0200, Hans Verkuil wrote:
> >>>>> +               u32 val;
> >>>>> +
> >>>>> +               fwnode_for_each_child_node(fwnode, child) {
> >>>>> +                       if (fwnode_property_read_u32(child, *props, 
> >>>>> &val))
> >>>>> +                               continue;
> >>>>> +
> >>>>> +                       if (val == *args)
> >>>>> +                               break;
> >>>>
> >>>> I'm lost. This really needs comments and perhaps even an DT or ACPI 
> >>>> example
> >>>> so you can see what exactly it is we're doing here.
> >>>
> >>> I'll add comments to the code. A good example will be ACPI documentation
> >>> for LEDs, see 17th patch in v9. That will go through the linux-pm tree so
> >>> it won't be available in the same tree for a while.
> >>
> >> Ideally an ACPI and an equivalent DT example would be nice to have, but I 
> >> might
> >> be asking too much. I'm not that familiar with ACPI, so for me a DT example
> >> is easier.
> > 
> > This won't be useful on DT although you could technically use it. In DT you
> > can directly refer to any node but on ACPI you can just refer to devices,
> > hence this.
> 
> So this function will effectively only be used with acpi? That should be
> documented. I think that explains some of my confusion since I was trying
> to map this code to a device tree, without much success.

I'll add to the documentation of the function:

 * While it is technically possible to use this function on DT, it is only
 * meaningful on ACPI. On Device tree you can refer to any node in the tree but
 * on ACPI the references are limited to devices.

> 
> > Would you be happy with the leds.txt example? I think it's a good example
> > as it's directly related to this.
> 
> Yes, that will work.

I'll add a separate patch that I'll post later on. The ACPI documentation
should get merged first.

-- 
Sakari Ailus
e-mail: sakari.ai...@iki.fi

Reply via email to