u-boot/libfdt
David Gibson 2c0b843e71 libfdt: Rework fdt_next_node()
Currently fdt_next_node() will find the next node in the blob
regardless of whether it is above, below or at the same level in the
tree as the starting node - the depth parameter is updated to indicate
which is the case.  When a depth parameter is supplied, this patch
makes it instead terminate immediately when it finds the END_NODE tag
for a node at depth 0.  In this case it returns the offset immediately
past the END_NODE tag.

This has a couple of advantages.  First, this slightly simplifies
fdt_subnode_offset(), which no longer needs to explicitly check that
fdt_next_node()'s iteration hasn't left the starting node.  Second,
this allows fdt_next_node() to be used to implement
_fdt_node_end_offset() considerably simplifying the latter function.

The other users of fdt_next_node() either don't need to iterate out of
the starting node, or don't pass a depth parameter at all.  Any
callers that really need to iterate out of the starting node, but keep
tracking depth can do so by biasing the initial depth value.

This is a semantic change, but I think it's very unlikely to break any
existing library users.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2009-04-01 19:29:22 -04:00
..
fdt.c libfdt: Rework fdt_next_node() 2009-04-01 19:29:22 -04:00
fdt_ro.c libfdt: Rework fdt_next_node() 2009-04-01 19:29:22 -04:00
fdt_rw.c libfdt: Increase namespace-pollution paranoia 2008-08-24 22:20:49 -04:00
fdt_strerror.c libfdt: Increase namespace-pollution paranoia 2008-08-24 22:20:49 -04:00
fdt_sw.c libfdt: Increase namespace-pollution paranoia 2008-08-24 22:20:49 -04:00
fdt_wip.c libfdt: Rework fdt_next_node() 2009-04-01 19:29:22 -04:00
libfdt_internal.h libfdt: Increase namespace-pollution paranoia 2008-08-24 22:20:49 -04:00
Makefile Fix FIT and FDT support to have CONFIG_OF_LIBFDT and CONFIG_FIT independent 2008-12-13 23:31:49 +01:00
README Big white-space cleanup. 2008-05-21 00:14:08 +02:00

The libfdt functionality was written by David Gibson.  The original
source came from the git repository:

URL:		git://ozlabs.org/home/dgibson/git/libfdt.git

author		David Gibson <dgibson@sneetch.(none)>
		Fri, 23 Mar 2007 04:16:54 +0000 (15:16 +1100)
committer	David Gibson <dgibson@sneetch.(none)>
		Fri, 23 Mar 2007 04:16:54 +0000 (15:16 +1100)
commit		857f54e79f74429af20c2b5ecc00ee98af6a3b8b
tree		2f648f0f88225a51ded452968d28b4402df8ade0
parent		07a12a08005f3b5cd9337900a6551e450c07b515

To adapt for u-boot usage, only the applicable files were copied and
imported into the u-boot git repository.
Omitted:
* GPL - u-boot comes with a copy of the GPL license
* test subdirectory - not directly useful for u-boot

After importing, other customizations were performed.  See the git log
for details.

Jerry Van Baren