diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2007-11-13 09:59:38 +1100 |
---|---|---|
committer | Jon Loeliger <jdl@freescale.com> | 2007-11-13 07:40:06 -0600 |
commit | 7346858f8139cb143269bbc728b77072074ae997 (patch) | |
tree | 442500075d6ea2f65032271a39b0a6052b1ee940 /tests/rw_tree1.c | |
parent | f6588bc32fd46d63da6058f37ce799ab948c3513 (diff) | |
download | dtc-7346858f8139cb143269bbc728b77072074ae997.zip dtc-7346858f8139cb143269bbc728b77072074ae997.tar.gz dtc-7346858f8139cb143269bbc728b77072074ae997.tar.bz2 |
libfdt: Add phandle related functions
This patch adds fdt_get_phandle() and fdt_node_offset_by_phandle()
functions to libfdt. fdt_get_phandle() will retreive the phandle
value of a given node, and fdt_node_offset_by_phandle() will locate a
node given a phandle.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'tests/rw_tree1.c')
-rw-r--r-- | tests/rw_tree1.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/rw_tree1.c b/tests/rw_tree1.c index d063947..71f7b98 100644 --- a/tests/rw_tree1.c +++ b/tests/rw_tree1.c @@ -85,8 +85,12 @@ int main(int argc, char *argv[]) CHECK(fdt_setprop_typed(fdt, offset, "prop-int", TEST_VALUE_1)); OFF_CHECK(offset, fdt_add_subnode(fdt, 0, "subnode@2")); + CHECK(fdt_setprop_typed(fdt, offset, "linux,phandle", + cpu_to_fdt32(PHANDLE_1))); CHECK(fdt_setprop_typed(fdt, offset, "prop-int", TEST_VALUE_2)); OFF_CHECK(offset, fdt_add_subnode(fdt, offset, "subsubnode@0")); + CHECK(fdt_setprop_typed(fdt, offset, "linux,phandle", + cpu_to_fdt32(PHANDLE_2))); CHECK(fdt_setprop(fdt, offset, "compatible", "subsubnode2\0subsubnode", 23)); CHECK(fdt_setprop_typed(fdt, offset, "prop-int", TEST_VALUE_2)); |