Lines Matching refs:offset

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