OF_child, OF_parent, OF_peer — navigate device tree
Contents
Description
OF_child() returns the phandle value of the first child of the node. Zero is returned if there are no
child nodes.
OF_parent() returns the phandle for the parent of the node. Zero is returned if node is the root node.
OF_peer() returns the phandle value of the next sibling of the node. Zero is returned if there is no
sibling node.
Examples
phandle_t node, child;
...
for (child = OF_child(node); child != 0; child = OF_peer(child) {
...
}
Name
OF_child, OF_parent, OF_peer — navigate device tree
See Also
OF_finddevice(9)
Synopsis
#include<dev/ofw/ofw_bus.h>#include<dev/ofw/ofw_bus_subr.h>phandle_tOF_child(phandle_tnode);
phandle_tOF_parent(phandle_tnode);
phandle_tOF_peer(phandle_tnode);
