diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2008-02-12 11:58:31 +1100 |
---|---|---|
committer | Gerald Van Baren <vanbaren@cideas.com> | 2008-03-18 21:03:45 -0400 |
commit | ae0b5908de3b9855f8931bc9b32c9fc4962df5a9 (patch) | |
tree | 95f9df10a186b5c4c62d311f8df8d0830b06e7d4 /include/libfdt.h | |
parent | 9eaeb07a7185d852c7aa10735ecd4e9edf24fb5d (diff) | |
download | u-boot-imx-ae0b5908de3b9855f8931bc9b32c9fc4962df5a9.zip u-boot-imx-ae0b5908de3b9855f8931bc9b32c9fc4962df5a9.tar.gz u-boot-imx-ae0b5908de3b9855f8931bc9b32c9fc4962df5a9.tar.bz2 |
libfdt: Add and use a node iteration helper function.
This patch adds an fdt_next_node() function which can be used to
iterate through nodes of the tree while keeping track of depth. This
function is used to simplify the iteration code in a lot of other
functions, and is also exported for use by library users.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'include/libfdt.h')
-rw-r--r-- | include/libfdt.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/libfdt.h b/include/libfdt.h index f634a9c..beeacb2 100644 --- a/include/libfdt.h +++ b/include/libfdt.h @@ -131,6 +131,12 @@ static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen) uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset); /**********************************************************************/ +/* Traversal functions */ +/**********************************************************************/ + +int fdt_next_node(const void *fdt, int offset, int *depth); + +/**********************************************************************/ /* General functions */ /**********************************************************************/ |