libfdt: Add fdt_parent_offset() and supporting functions

This patch adds an fdt_parent_offset() function which returns an
offset to the parent node of a given node.  It also adds two helper
functions which are used to implement fdt_parent_offset() but are also
exported: fdt_supernode_atdepth_offset() which returns the ancestor of
a given node at a specified depth from the root of the tree, and
fdt_node_depth() which returns the depth of a given node.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2007-08-30 14:54:04 +10:00 committed by Jon Loeliger
parent 037db263e0
commit 1248237c7e
6 changed files with 314 additions and 2 deletions

View file

@ -35,6 +35,8 @@ tree1_tests () {
run_test get_name $TREE
run_test getprop $TREE
run_test get_path $TREE
run_test supernode_atdepth_offset $TREE
run_test parent_offset $TREE
run_test notfound $TREE
# Write-in-place tests