Lines Matching refs:offset

58 static int _fdt_nodename_eq(const void *fdt, int offset,  in _fdt_nodename_eq()  argument
61 const char *p = fdt_offset_ptr(fdt, offset + FDT_TAGSIZE, len+1); in _fdt_nodename_eq()
94 int offset; in fdt_get_max_phandle() local
96 for (offset = fdt_next_node(fdt, -1, NULL);; in fdt_get_max_phandle()
97 offset = fdt_next_node(fdt, offset, NULL)) { in fdt_get_max_phandle()
100 if (offset == -FDT_ERR_NOTFOUND) in fdt_get_max_phandle()
103 if (offset < 0) in fdt_get_max_phandle()
106 phandle = fdt_get_phandle(fdt, offset); in fdt_get_max_phandle()
134 static int _nextprop(const void *fdt, int offset) in _nextprop() argument
140 tag = fdt_next_tag(fdt, offset, &nextoffset); in _nextprop()
150 return offset; in _nextprop()
152 offset = nextoffset; in _nextprop()
158 int fdt_subnode_offset_namelen(const void *fdt, int offset, in fdt_subnode_offset_namelen() argument
166 (offset >= 0) && (depth >= 0); in fdt_subnode_offset_namelen()
167 offset = fdt_next_node(fdt, offset, &depth)) in fdt_subnode_offset_namelen()
169 && _fdt_nodename_eq(fdt, offset, name, namelen)) in fdt_subnode_offset_namelen()
170 return offset; in fdt_subnode_offset_namelen()
174 return offset; /* error */ in fdt_subnode_offset_namelen()
187 int offset = 0; in fdt_path_offset_namelen() local
201 offset = fdt_path_offset(fdt, p); in fdt_path_offset_namelen()
212 return offset; in fdt_path_offset_namelen()
218 offset = fdt_subnode_offset_namelen(fdt, offset, p, q-p); in fdt_path_offset_namelen()
219 if (offset < 0) in fdt_path_offset_namelen()
220 return offset; in fdt_path_offset_namelen()
225 return offset; in fdt_path_offset_namelen()
255 int offset; in fdt_first_property_offset() local
257 if ((offset = _fdt_check_node_offset(fdt, nodeoffset)) < 0) in fdt_first_property_offset()
258 return offset; in fdt_first_property_offset()
260 return _nextprop(fdt, offset); in fdt_first_property_offset()
263 int fdt_next_property_offset(const void *fdt, int offset) in fdt_next_property_offset() argument
265 if ((offset = _fdt_check_prop_offset(fdt, offset)) < 0) in fdt_next_property_offset()
266 return offset; in fdt_next_property_offset()
268 return _nextprop(fdt, offset); in fdt_next_property_offset()
272 int offset, in fdt_get_property_by_offset() argument
278 if ((err = _fdt_check_prop_offset(fdt, offset)) < 0) { in fdt_get_property_by_offset()
284 prop = _fdt_offset_ptr(fdt, offset); in fdt_get_property_by_offset()
293 int offset, in fdt_get_property_namelen() argument
297 for (offset = fdt_first_property_offset(fdt, offset); in fdt_get_property_namelen()
298 (offset >= 0); in fdt_get_property_namelen()
299 (offset = fdt_next_property_offset(fdt, offset))) { in fdt_get_property_namelen()
302 if (!(prop = fdt_get_property_by_offset(fdt, offset, lenp))) { in fdt_get_property_namelen()
303 offset = -FDT_ERR_INTERNAL; in fdt_get_property_namelen()
312 *lenp = offset; in fdt_get_property_namelen()
336 const void *fdt_getprop_by_offset(const void *fdt, int offset, in fdt_getprop_by_offset() argument
341 prop = fdt_get_property_by_offset(fdt, offset, lenp); in fdt_getprop_by_offset()
392 int offset, depth, namelen; in fdt_get_path() local
400 for (offset = 0, depth = 0; in fdt_get_path()
401 (offset >= 0) && (offset <= nodeoffset); in fdt_get_path()
402 offset = fdt_next_node(fdt, offset, &depth)) { in fdt_get_path()
411 name = fdt_get_name(fdt, offset, &namelen); in fdt_get_path()
422 if (offset == nodeoffset) { in fdt_get_path()
433 if ((offset == -FDT_ERR_NOTFOUND) || (offset >= 0)) in fdt_get_path()
435 else if (offset == -FDT_ERR_BADOFFSET) in fdt_get_path()
438 return offset; /* error from fdt_next_node() */ in fdt_get_path()
444 int offset, depth; in fdt_supernode_atdepth_offset() local
452 for (offset = 0, depth = 0; in fdt_supernode_atdepth_offset()
453 (offset >= 0) && (offset <= nodeoffset); in fdt_supernode_atdepth_offset()
454 offset = fdt_next_node(fdt, offset, &depth)) { in fdt_supernode_atdepth_offset()
456 supernodeoffset = offset; in fdt_supernode_atdepth_offset()
458 if (offset == nodeoffset) { in fdt_supernode_atdepth_offset()
469 if ((offset == -FDT_ERR_NOTFOUND) || (offset >= 0)) in fdt_supernode_atdepth_offset()
471 else if (offset == -FDT_ERR_BADOFFSET) in fdt_supernode_atdepth_offset()
474 return offset; /* error from fdt_next_node() */ in fdt_supernode_atdepth_offset()
502 int offset; in fdt_node_offset_by_prop_value() local
513 for (offset = fdt_next_node(fdt, startoffset, NULL); in fdt_node_offset_by_prop_value()
514 offset >= 0; in fdt_node_offset_by_prop_value()
515 offset = fdt_next_node(fdt, offset, NULL)) { in fdt_node_offset_by_prop_value()
516 val = fdt_getprop(fdt, offset, propname, &len); in fdt_node_offset_by_prop_value()
519 return offset; in fdt_node_offset_by_prop_value()
522 return offset; /* error from fdt_next_node() */ in fdt_node_offset_by_prop_value()
527 int offset; in fdt_node_offset_by_phandle() local
540 for (offset = fdt_next_node(fdt, -1, NULL); in fdt_node_offset_by_phandle()
541 offset >= 0; in fdt_node_offset_by_phandle()
542 offset = fdt_next_node(fdt, offset, NULL)) { in fdt_node_offset_by_phandle()
543 if (fdt_get_phandle(fdt, offset) == phandle) in fdt_node_offset_by_phandle()
544 return offset; in fdt_node_offset_by_phandle()
547 return offset; /* error from fdt_next_node() */ in fdt_node_offset_by_phandle()
683 int offset, err; in fdt_node_offset_by_compatible() local
692 for (offset = fdt_next_node(fdt, startoffset, NULL); in fdt_node_offset_by_compatible()
693 offset >= 0; in fdt_node_offset_by_compatible()
694 offset = fdt_next_node(fdt, offset, NULL)) { in fdt_node_offset_by_compatible()
695 err = fdt_node_check_compatible(fdt, offset, compatible); in fdt_node_offset_by_compatible()
699 return offset; in fdt_node_offset_by_compatible()
702 return offset; /* error from fdt_next_node() */ in fdt_node_offset_by_compatible()