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

Re: [Xen-devel] [RFC for-4.5 05/12] xen/dts: Add dt_parse_phandle_with_args and dt_parse_phandle

On Wed, 2014-02-19 at 16:17 +0000, Julien Grall wrote:
> >> +/**
> >> + * dt_parse_phandle - Resolve a phandle property to a device_node pointer
> >> + * @np: Pointer to device node holding phandle property
> >> + * @phandle_name: Name of property holding a phandle value
> >> + * @index: For properties holding a table of phandles, this is the index 
> >> into
> >> + *         the table
> > 
> > Otherwise it is -1 or something else?
> Even with one element, the property contains a table of phandles. So,
> the first index is always 0.

OK, so the "For a properties holding a table..." bit is misleading
(that's the "otherwise" I was referring too, e..g properties which do
not hold a table0, since this is always the index, even if the table has
a single element.

> > How do I decide the correct size for out_args?
> out_args is a structure dt_phandle_args which contains the node and an
> array of arguments.
> The function is designed to parse one phandle by one phandle. So
> out_args is either NULL (we don't want to get the info) or contains a
> pointer to the structure to fill.
> The description of out_args seems clear to me. Does it miss something?

No, I didn't realise that the array was within dt_phandle_args rather
than out_args itself being a pointer to an array (the plural name is a
bit confusing in that regard).

I see the name comes from Linux, so no need to change.


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.