Lines Matching +full:depth +full:-

1 // SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
3 * libfdt - Flat Device Tree manipulation
14 * Minimal sanity check for a read-only tree. fdt_ro_probe_() checks
25 /* The device tree must be at an 8-byte aligned address */ in fdt_ro_probe_()
27 return -FDT_ERR_ALIGNMENT; in fdt_ro_probe_()
33 return -FDT_ERR_BADVERSION; in fdt_ro_probe_()
36 return -FDT_ERR_BADVERSION; in fdt_ro_probe_()
39 /* Unfinished sequential-write blob */ in fdt_ro_probe_()
41 return -FDT_ERR_BADSTATE; in fdt_ro_probe_()
43 return -FDT_ERR_BADMAGIC; in fdt_ro_probe_()
49 return -FDT_ERR_TRUNCATED; in fdt_ro_probe_()
93 /* The device tree must be at an 8-byte aligned address */ in fdt_check_header()
95 return -FDT_ERR_ALIGNMENT; in fdt_check_header()
98 return -FDT_ERR_BADMAGIC; in fdt_check_header()
103 return -FDT_ERR_BADVERSION; in fdt_check_header()
105 return -FDT_ERR_BADVERSION; in fdt_check_header()
112 return -FDT_ERR_TRUNCATED; in fdt_check_header()
117 return -FDT_ERR_TRUNCATED; in fdt_check_header()
125 return -FDT_ERR_TRUNCATED; in fdt_check_header()
130 return -FDT_ERR_TRUNCATED; in fdt_check_header()
137 return -FDT_ERR_TRUNCATED; in fdt_check_header()
172 *nextoffset = -FDT_ERR_TRUNCATED; in fdt_next_tag()
179 *nextoffset = -FDT_ERR_BADSTRUCTURE; in fdt_next_tag()
194 /* skip-name offset, length and value */ in fdt_next_tag()
195 offset += sizeof(struct fdt_property) - FDT_TAGSIZE in fdt_next_tag()
199 ((offset - fdt32_to_cpu(*lenp)) % 8) != 0) in fdt_next_tag()
212 if (!fdt_offset_ptr(fdt, startoffset, offset - startoffset)) in fdt_next_tag()
223 return -FDT_ERR_BADOFFSET; in fdt_check_node_offset_()
226 return -FDT_ERR_BADOFFSET; in fdt_check_node_offset_()
235 return -FDT_ERR_BADOFFSET; in fdt_check_prop_offset_()
238 return -FDT_ERR_BADOFFSET; in fdt_check_prop_offset_()
243 int fdt_next_node(const void *fdt, int offset, int *depth) in fdt_next_node() argument
262 if (depth) in fdt_next_node()
263 (*depth)++; in fdt_next_node()
267 if (depth && ((--(*depth)) < 0)) in fdt_next_node()
273 || ((nextoffset == -FDT_ERR_TRUNCATED) && !depth)) in fdt_next_node()
274 return -FDT_ERR_NOTFOUND; in fdt_next_node()
285 int depth = 0; in fdt_first_subnode() local
287 offset = fdt_next_node(fdt, offset, &depth); in fdt_first_subnode()
288 if (offset < 0 || depth != 1) in fdt_first_subnode()
289 return -FDT_ERR_NOTFOUND; in fdt_first_subnode()
296 int depth = 1; in fdt_next_subnode() local
299 * With respect to the parent, the depth of the next subnode will be in fdt_next_subnode()
303 offset = fdt_next_node(fdt, offset, &depth); in fdt_next_subnode()
304 if (offset < 0 || depth < 1) in fdt_next_subnode()
305 return -FDT_ERR_NOTFOUND; in fdt_next_subnode()
306 } while (depth > 1); in fdt_next_subnode()
314 const char *last = strtab + tabsize - len; in fdt_find_string_()
326 return -FDT_ERR_NOSPACE; in fdt_move()
331 return -FDT_ERR_NOSPACE; in fdt_move()