Hi,
On 8/12/19 11:28 PM, Stefano Stabellini wrote:
Add a new parameter to device_tree_for_each_node: node, the node to
start the search from. Passing 0 triggers the old behavior.
Set min_depth to depth of the current node + 1 and replace the for
loop with a do/while loop to avoid scanning siblings of the initial node
passed as an argument.
We need this change because in follow-up patches we want to be able to
use reuse device_tree_for_each_node to call a function for each children
nodes of a provided node and the node itself.
I have to say this would be fairly confusing for reserved-memory because
you are only expecting to parse the subnode.
Furthermore, in the unlikely event to first node does have a property
"regs", then #address-cells and #size-cells is going to be incorrect (we
don't look up for its parent...).
So I think it would be best to consider to ignore the first node. This
should not be an issue as none of the user care about the root node (i.e
/). It would also makes the interface more straightforward.
Cheers,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel