From ae0b5908de3b9855f8931bc9b32c9fc4962df5a9 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Tue, 12 Feb 2008 11:58:31 +1100 Subject: 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 --- include/libfdt.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/libfdt.h') 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 */ /**********************************************************************/ -- cgit v1.1