Lines Matching refs:offset

17 static int _fdt_nodename_eq(const void *fdt, int offset,  in _fdt_nodename_eq()  argument
20 const char *p = fdt_offset_ptr(fdt, offset + FDT_TAGSIZE, len+1); in _fdt_nodename_eq()
53 int offset; in fdt_get_max_phandle() local
55 for (offset = fdt_next_node(fdt, -1, NULL);; in fdt_get_max_phandle()
56 offset = fdt_next_node(fdt, offset, NULL)) { in fdt_get_max_phandle()
59 if (offset == -FDT_ERR_NOTFOUND) in fdt_get_max_phandle()
62 if (offset < 0) in fdt_get_max_phandle()
65 phandle = fdt_get_phandle(fdt, offset); in fdt_get_max_phandle()
93 static int _nextprop(const void *fdt, int offset) in _nextprop() argument
99 tag = fdt_next_tag(fdt, offset, &nextoffset); in _nextprop()
109 return offset; in _nextprop()
111 offset = nextoffset; in _nextprop()
117 int fdt_subnode_offset_namelen(const void *fdt, int offset, in fdt_subnode_offset_namelen() argument
125 (offset >= 0) && (depth >= 0); in fdt_subnode_offset_namelen()
126 offset = fdt_next_node(fdt, offset, &depth)) in fdt_subnode_offset_namelen()
128 && _fdt_nodename_eq(fdt, offset, name, namelen)) in fdt_subnode_offset_namelen()
129 return offset; in fdt_subnode_offset_namelen()
133 return offset; /* error */ in fdt_subnode_offset_namelen()
165 int offset = 0; in fdt_path_offset_namelen() local
179 offset = fdt_path_offset(fdt, p); in fdt_path_offset_namelen()
191 return offset; in fdt_path_offset_namelen()
197 offset = fdt_subnode_offset_namelen(fdt, offset, p, q-p); in fdt_path_offset_namelen()
198 if (offset < 0) in fdt_path_offset_namelen()
199 return offset; in fdt_path_offset_namelen()
204 return offset; in fdt_path_offset_namelen()
234 int offset; in fdt_first_property_offset() local
236 if ((offset = fdt_check_node_offset_(fdt, nodeoffset)) < 0) in fdt_first_property_offset()
237 return offset; in fdt_first_property_offset()
239 return _nextprop(fdt, offset); in fdt_first_property_offset()
242 int fdt_next_property_offset(const void *fdt, int offset) in fdt_next_property_offset() argument
244 if ((offset = fdt_check_prop_offset_(fdt, offset)) < 0) in fdt_next_property_offset()
245 return offset; in fdt_next_property_offset()
247 return _nextprop(fdt, offset); in fdt_next_property_offset()
251 int offset, in fdt_get_property_by_offset() argument
257 if ((err = fdt_check_prop_offset_(fdt, offset)) < 0) { in fdt_get_property_by_offset()
263 prop = fdt_offset_ptr_(fdt, offset); in fdt_get_property_by_offset()
272 int offset, in fdt_get_property_namelen() argument
276 for (offset = fdt_first_property_offset(fdt, offset); in fdt_get_property_namelen()
277 (offset >= 0); in fdt_get_property_namelen()
278 (offset = fdt_next_property_offset(fdt, offset))) { in fdt_get_property_namelen()
281 if (!(prop = fdt_get_property_by_offset(fdt, offset, lenp))) { in fdt_get_property_namelen()
282 offset = -FDT_ERR_INTERNAL; in fdt_get_property_namelen()
291 *lenp = offset; in fdt_get_property_namelen()
315 const void *fdt_getprop_by_offset(const void *fdt, int offset, in fdt_getprop_by_offset() argument
320 prop = fdt_get_property_by_offset(fdt, offset, lenp); in fdt_getprop_by_offset()
371 int offset, depth, namelen; in fdt_get_path() local
379 for (offset = 0, depth = 0; in fdt_get_path()
380 (offset >= 0) && (offset <= nodeoffset); in fdt_get_path()
381 offset = fdt_next_node(fdt, offset, &depth)) { in fdt_get_path()
390 name = fdt_get_name(fdt, offset, &namelen); in fdt_get_path()
401 if (offset == nodeoffset) { in fdt_get_path()
412 if ((offset == -FDT_ERR_NOTFOUND) || (offset >= 0)) in fdt_get_path()
414 else if (offset == -FDT_ERR_BADOFFSET) in fdt_get_path()
417 return offset; /* error from fdt_next_node() */ in fdt_get_path()
423 int offset, depth; in fdt_supernode_atdepth_offset() local
431 for (offset = 0, depth = 0; in fdt_supernode_atdepth_offset()
432 (offset >= 0) && (offset <= nodeoffset); in fdt_supernode_atdepth_offset()
433 offset = fdt_next_node(fdt, offset, &depth)) { in fdt_supernode_atdepth_offset()
435 supernodeoffset = offset; in fdt_supernode_atdepth_offset()
437 if (offset == nodeoffset) { in fdt_supernode_atdepth_offset()
448 if ((offset == -FDT_ERR_NOTFOUND) || (offset >= 0)) in fdt_supernode_atdepth_offset()
450 else if (offset == -FDT_ERR_BADOFFSET) in fdt_supernode_atdepth_offset()
453 return offset; /* error from fdt_next_node() */ in fdt_supernode_atdepth_offset()
481 int offset; in fdt_node_offset_by_prop_value() local
492 for (offset = fdt_next_node(fdt, startoffset, NULL); in fdt_node_offset_by_prop_value()
493 offset >= 0; in fdt_node_offset_by_prop_value()
494 offset = fdt_next_node(fdt, offset, NULL)) { in fdt_node_offset_by_prop_value()
495 val = fdt_getprop(fdt, offset, propname, &len); in fdt_node_offset_by_prop_value()
498 return offset; in fdt_node_offset_by_prop_value()
501 return offset; /* error from fdt_next_node() */ in fdt_node_offset_by_prop_value()
506 int offset; in fdt_node_offset_by_phandle() local
519 for (offset = fdt_next_node(fdt, -1, NULL); in fdt_node_offset_by_phandle()
520 offset >= 0; in fdt_node_offset_by_phandle()
521 offset = fdt_next_node(fdt, offset, NULL)) { in fdt_node_offset_by_phandle()
522 if (fdt_get_phandle(fdt, offset) == phandle) in fdt_node_offset_by_phandle()
523 return offset; in fdt_node_offset_by_phandle()
526 return offset; /* error from fdt_next_node() */ in fdt_node_offset_by_phandle()
662 int offset, err; in fdt_node_offset_by_compatible() local
671 for (offset = fdt_next_node(fdt, startoffset, NULL); in fdt_node_offset_by_compatible()
672 offset >= 0; in fdt_node_offset_by_compatible()
673 offset = fdt_next_node(fdt, offset, NULL)) { in fdt_node_offset_by_compatible()
674 err = fdt_node_check_compatible(fdt, offset, compatible); in fdt_node_offset_by_compatible()
678 return offset; in fdt_node_offset_by_compatible()
681 return offset; /* error from fdt_next_node() */ in fdt_node_offset_by_compatible()