Simon Glass 88f95bbadd libfdt: Add fdt_next_subnode() to permit easy subnode iteration
Iterating through subnodes with libfdt is a little painful to write as we
need something like this:

for (depth = 0, count = 0,
	offset = fdt_next_node(fdt, parent_offset, &depth);
     (offset >= 0) && (depth > 0);
     offset = fdt_next_node(fdt, offset, &depth)) {
	if (depth == 1) {
		/* code body */
	}
}

Using fdt_next_subnode() we can instead write this, which is shorter and
easier to get right:

for (offset = fdt_first_subnode(fdt, parent_offset);
     offset >= 0;
     offset = fdt_next_subnode(fdt, offset)) {
	/* code body */
}

Also, it doesn't require two levels of indentation for the loop body.

Signed-off-by: Simon Glass <sjg@chromium.org>
(Cherry-picked from dtc commit 4e76ec79)
Acked-by: Gerald Van Baren <vanbaren@cideas.com>
2013-05-14 15:37:25 -04:00
..
2013-04-01 16:33:52 -04:00
2013-04-01 16:33:52 -04:00
2013-04-01 16:33:52 -04:00
2013-02-20 16:48:17 +09:00
2012-08-09 23:42:20 +02:00
2011-08-01 15:19:40 +02:00
2012-05-15 08:31:37 +02:00
2012-11-02 15:20:41 -07:00
2011-08-04 23:34:02 +02:00
2011-08-01 15:19:40 +02:00
2013-04-01 16:33:52 -04:00
2013-05-14 15:37:24 -04:00
2012-12-06 13:56:39 -07:00
2012-03-27 22:05:28 +02:00
2013-03-12 23:28:40 +01:00
2011-10-22 01:22:21 +02:00
2012-12-11 13:17:34 -07:00
2013-02-19 17:01:26 -05:00
2011-08-04 23:34:02 +02:00
2013-02-08 22:32:38 -05:00
2012-10-22 14:31:25 -05:00
2013-04-01 16:33:52 -04:00
2012-10-22 14:31:25 -05:00
2012-05-15 08:31:34 +02:00
2012-11-27 09:41:10 -07:00
2013-03-29 20:10:42 +09:00
2013-01-08 10:54:33 +09:00
2012-11-15 21:08:20 +09:00
2013-03-15 16:14:00 -04:00
2013-03-27 15:30:11 -04:00
2012-05-25 09:15:10 +02:00
2013-04-01 16:33:52 -04:00
2012-10-26 16:28:07 +02:00
2012-10-23 15:23:26 -05:00
2012-11-04 11:00:36 -07:00
2011-10-05 22:03:11 +02:00
2013-04-01 16:33:52 -04:00
2012-11-27 17:26:48 -06:00
2011-08-04 23:34:02 +02:00
2011-08-04 23:34:02 +02:00
2011-08-01 15:19:40 +02:00
2012-11-10 19:45:58 +08:00
2013-04-01 16:33:52 -04:00
2012-05-15 08:31:40 +02:00
2013-04-12 14:13:13 -07:00
2013-04-12 14:13:13 -07:00
2012-05-15 08:31:37 +02:00
2012-12-20 17:04:21 +01:00
2011-09-30 22:00:55 +02:00
2013-04-01 16:33:52 -04:00
2011-08-01 15:19:40 +02:00
2012-10-15 11:53:59 -07:00
2011-08-01 15:19:40 +02:00
2013-04-01 16:33:52 -04:00