[U-Boot] [RFC] fdt expert advice needed
Scott Wood
scottwood at freescale.com
Fri Jan 30 22:22:12 CET 2009
Scott Wood wrote:
> Matthias Fuchs wrote:
>> Now I want to replace the above code to only touch the ns16550 compatible nodes
>> that are direct childs of /plb/opb. Not those under /plb/ebc and even not those under
>> /plb/opb/ebc. This is not easy to do with the fdt API. Below you find my first and dirty
>> hack.
>>
>> Isn't there a more simple way to do so? Don't bother me about the printf, variable names etc.
>> It's just for discussion.
>
> Take the node that you want to search under (/plb/opb), and pass it to
> fdt_next_node(), with an initial depth of zero. Continue until depth
> returns to zero (or less).
I just saw that you want to restrict it to direct children -- for that,
ignore any nodes where depth != 1.
-Scott
More information about the U-Boot
mailing list