Lines Matching refs:offset
13 static int fdt_nodename_eq_(const void *fdt, int offset, in fdt_nodename_eq_() argument
17 const char *p = fdt_get_name(fdt, offset, &olen); in fdt_nodename_eq_()
117 int offset = -1; in fdt_find_max_phandle() local
122 offset = fdt_next_node(fdt, offset, NULL); in fdt_find_max_phandle()
123 if (offset < 0) { in fdt_find_max_phandle()
124 if (offset == -FDT_ERR_NOTFOUND) in fdt_find_max_phandle()
127 return offset; in fdt_find_max_phandle()
130 value = fdt_get_phandle(fdt, offset); in fdt_find_max_phandle()
162 unsigned int offset = n * sizeof(struct fdt_reserve_entry); in fdt_mem_rsv() local
163 unsigned int absoffset = fdt_off_mem_rsvmap(fdt) + offset; in fdt_mem_rsv()
201 static int nextprop_(const void *fdt, int offset) in nextprop_() argument
207 tag = fdt_next_tag(fdt, offset, &nextoffset); in nextprop_()
217 return offset; in nextprop_()
219 offset = nextoffset; in nextprop_()
225 int fdt_subnode_offset_namelen(const void *fdt, int offset, in fdt_subnode_offset_namelen() argument
233 (offset >= 0) && (depth >= 0); in fdt_subnode_offset_namelen()
234 offset = fdt_next_node(fdt, offset, &depth)) in fdt_subnode_offset_namelen()
236 && fdt_nodename_eq_(fdt, offset, name, namelen)) in fdt_subnode_offset_namelen()
237 return offset; in fdt_subnode_offset_namelen()
241 return offset; /* error */ in fdt_subnode_offset_namelen()
254 int offset = 0; in fdt_path_offset_namelen() local
268 offset = fdt_path_offset(fdt, p); in fdt_path_offset_namelen()
279 return offset; in fdt_path_offset_namelen()
285 offset = fdt_subnode_offset_namelen(fdt, offset, p, q-p); in fdt_path_offset_namelen()
286 if (offset < 0) in fdt_path_offset_namelen()
287 return offset; in fdt_path_offset_namelen()
292 return offset; in fdt_path_offset_namelen()
340 int offset; in fdt_first_property_offset() local
342 if ((offset = fdt_check_node_offset_(fdt, nodeoffset)) < 0) in fdt_first_property_offset()
343 return offset; in fdt_first_property_offset()
345 return nextprop_(fdt, offset); in fdt_first_property_offset()
348 int fdt_next_property_offset(const void *fdt, int offset) in fdt_next_property_offset() argument
350 if ((offset = fdt_check_prop_offset_(fdt, offset)) < 0) in fdt_next_property_offset()
351 return offset; in fdt_next_property_offset()
353 return nextprop_(fdt, offset); in fdt_next_property_offset()
357 int offset, in fdt_get_property_by_offset_() argument
364 (err = fdt_check_prop_offset_(fdt, offset)) < 0) { in fdt_get_property_by_offset_()
370 prop = fdt_offset_ptr_(fdt, offset); in fdt_get_property_by_offset_()
379 int offset, in fdt_get_property_by_offset() argument
391 return fdt_get_property_by_offset_(fdt, offset, lenp); in fdt_get_property_by_offset()
395 int offset, in fdt_get_property_namelen_() argument
401 for (offset = fdt_first_property_offset(fdt, offset); in fdt_get_property_namelen_()
402 (offset >= 0); in fdt_get_property_namelen_()
403 (offset = fdt_next_property_offset(fdt, offset))) { in fdt_get_property_namelen_()
406 prop = fdt_get_property_by_offset_(fdt, offset, lenp); in fdt_get_property_namelen_()
408 offset = -FDT_ERR_INTERNAL; in fdt_get_property_namelen_()
414 *poffset = offset; in fdt_get_property_namelen_()
420 *lenp = offset; in fdt_get_property_namelen_()
426 int offset, in fdt_get_property_namelen() argument
438 return fdt_get_property_namelen_(fdt, offset, name, namelen, lenp, in fdt_get_property_namelen()
469 const void *fdt_getprop_by_offset(const void *fdt, int offset, in fdt_getprop_by_offset() argument
474 prop = fdt_get_property_by_offset_(fdt, offset, lenp); in fdt_getprop_by_offset()
497 (offset + sizeof(*prop)) % 8 && fdt32_ld_(&prop->len) >= 8) in fdt_getprop_by_offset()
545 int offset, depth, namelen; in fdt_get_path() local
553 for (offset = 0, depth = 0; in fdt_get_path()
554 (offset >= 0) && (offset <= nodeoffset); in fdt_get_path()
555 offset = fdt_next_node(fdt, offset, &depth)) { in fdt_get_path()
564 name = fdt_get_name(fdt, offset, &namelen); in fdt_get_path()
575 if (offset == nodeoffset) { in fdt_get_path()
586 if ((offset == -FDT_ERR_NOTFOUND) || (offset >= 0)) in fdt_get_path()
588 else if (offset == -FDT_ERR_BADOFFSET) in fdt_get_path()
591 return offset; /* error from fdt_next_node() */ in fdt_get_path()
597 int offset, depth; in fdt_supernode_atdepth_offset() local
605 for (offset = 0, depth = 0; in fdt_supernode_atdepth_offset()
606 (offset >= 0) && (offset <= nodeoffset); in fdt_supernode_atdepth_offset()
607 offset = fdt_next_node(fdt, offset, &depth)) { in fdt_supernode_atdepth_offset()
609 supernodeoffset = offset; in fdt_supernode_atdepth_offset()
611 if (offset == nodeoffset) { in fdt_supernode_atdepth_offset()
623 if ((offset == -FDT_ERR_NOTFOUND) || (offset >= 0)) in fdt_supernode_atdepth_offset()
625 else if (offset == -FDT_ERR_BADOFFSET) in fdt_supernode_atdepth_offset()
629 return offset; /* error from fdt_next_node() */ in fdt_supernode_atdepth_offset()
658 int offset; in fdt_node_offset_by_prop_value() local
669 for (offset = fdt_next_node(fdt, startoffset, NULL); in fdt_node_offset_by_prop_value()
670 offset >= 0; in fdt_node_offset_by_prop_value()
671 offset = fdt_next_node(fdt, offset, NULL)) { in fdt_node_offset_by_prop_value()
672 val = fdt_getprop(fdt, offset, propname, &len); in fdt_node_offset_by_prop_value()
675 return offset; in fdt_node_offset_by_prop_value()
678 return offset; /* error from fdt_next_node() */ in fdt_node_offset_by_prop_value()
683 int offset; in fdt_node_offset_by_phandle() local
696 for (offset = fdt_next_node(fdt, -1, NULL); in fdt_node_offset_by_phandle()
697 offset >= 0; in fdt_node_offset_by_phandle()
698 offset = fdt_next_node(fdt, offset, NULL)) { in fdt_node_offset_by_phandle()
699 if (fdt_get_phandle(fdt, offset) == phandle) in fdt_node_offset_by_phandle()
700 return offset; in fdt_node_offset_by_phandle()
703 return offset; /* error from fdt_next_node() */ in fdt_node_offset_by_phandle()
839 int offset, err; in fdt_node_offset_by_compatible() local
848 for (offset = fdt_next_node(fdt, startoffset, NULL); in fdt_node_offset_by_compatible()
849 offset >= 0; in fdt_node_offset_by_compatible()
850 offset = fdt_next_node(fdt, offset, NULL)) { in fdt_node_offset_by_compatible()
851 err = fdt_node_check_compatible(fdt, offset, compatible); in fdt_node_offset_by_compatible()
855 return offset; in fdt_node_offset_by_compatible()
858 return offset; /* error from fdt_next_node() */ in fdt_node_offset_by_compatible()