\r
uint32_t fdt_next_tag(const void *fdt, int startoffset, int *nextoffset)\r
{\r
- const uint32_t *tagp, *lenp;\r
+ const fdt32_t *tagp, *lenp;\r
uint32_t tag;\r
int offset = startoffset;\r
const char *p;\r
return offset;\r
}\r
\r
+int fdt_first_subnode(const void *fdt, int offset)\r
+{\r
+ int depth = 0;\r
+\r
+ offset = fdt_next_node(fdt, offset, &depth);\r
+ if (offset < 0 || depth != 1)\r
+ return -FDT_ERR_NOTFOUND;\r
+\r
+ return offset;\r
+}\r
+\r
+int fdt_next_subnode(const void *fdt, int offset)\r
+{\r
+ int depth = 1;\r
+\r
+ /*\r
+ * With respect to the parent, the depth of the next subnode will be\r
+ * the same as the last.\r
+ */\r
+ do {\r
+ offset = fdt_next_node(fdt, offset, &depth);\r
+ if (offset < 0 || depth < 1)\r
+ return -FDT_ERR_NOTFOUND;\r
+ } while (depth > 1);\r
+\r
+ return offset;\r
+}\r
+\r
const char *_fdt_find_string(const char *strtab, int tabsize, const char *s)\r
{\r
int len = strlen(s) + 1;\r