Lines Matching refs:offset

58 static int fdt_nodename_eq_(const void *fdt, int offset,
62 const char *p = fdt_get_name(fdt, offset, &olen);
95 int offset;
97 for (offset = fdt_next_node(fdt, -1, NULL);;
98 offset = fdt_next_node(fdt, offset, NULL)) {
101 if (offset == -FDT_ERR_NOTFOUND)
104 if (offset < 0)
107 phandle = fdt_get_phandle(fdt, offset);
135 static int nextprop_(const void *fdt, int offset)
141 tag = fdt_next_tag(fdt, offset, &nextoffset);
151 return offset;
153 offset = nextoffset;
159 int fdt_subnode_offset_namelen(const void *fdt, int offset,
167 (offset >= 0) && (depth >= 0);
168 offset = fdt_next_node(fdt, offset, &depth))
170 && fdt_nodename_eq_(fdt, offset, name, namelen))
171 return offset;
175 return offset; /* error */
188 int offset = 0;
202 offset = fdt_path_offset(fdt, p);
213 return offset;
219 offset = fdt_subnode_offset_namelen(fdt, offset, p, q-p);
220 if (offset < 0)
221 return offset;
226 return offset;
274 int offset;
276 if ((offset = fdt_check_node_offset_(fdt, nodeoffset)) < 0)
277 return offset;
279 return nextprop_(fdt, offset);
282 int fdt_next_property_offset(const void *fdt, int offset)
284 if ((offset = fdt_check_prop_offset_(fdt, offset)) < 0)
285 return offset;
287 return nextprop_(fdt, offset);
291 int offset,
297 if ((err = fdt_check_prop_offset_(fdt, offset)) < 0) {
303 prop = fdt_offset_ptr_(fdt, offset);
312 int offset,
324 return fdt_get_property_by_offset_(fdt, offset, lenp);
328 int offset,
334 for (offset = fdt_first_property_offset(fdt, offset);
335 (offset >= 0);
336 (offset = fdt_next_property_offset(fdt, offset))) {
339 if (!(prop = fdt_get_property_by_offset_(fdt, offset, lenp))) {
340 offset = -FDT_ERR_INTERNAL;
346 *poffset = offset;
352 *lenp = offset;
358 int offset,
370 return fdt_get_property_namelen_(fdt, offset, name, namelen, lenp,
401 const void *fdt_getprop_by_offset(const void *fdt, int offset,
406 prop = fdt_get_property_by_offset_(fdt, offset, lenp);
413 if (fdt_version(fdt) < 0x10 && (offset + sizeof(*prop)) % 8 &&
462 int offset, depth, namelen;
470 for (offset = 0, depth = 0;
471 (offset >= 0) && (offset <= nodeoffset);
472 offset = fdt_next_node(fdt, offset, &depth)) {
481 name = fdt_get_name(fdt, offset, &namelen);
492 if (offset == nodeoffset) {
503 if ((offset == -FDT_ERR_NOTFOUND) || (offset >= 0))
505 else if (offset == -FDT_ERR_BADOFFSET)
508 return offset; /* error from fdt_next_node() */
514 int offset, depth;
522 for (offset = 0, depth = 0;
523 (offset >= 0) && (offset <= nodeoffset);
524 offset = fdt_next_node(fdt, offset, &depth)) {
526 supernodeoffset = offset;
528 if (offset == nodeoffset) {
539 if ((offset == -FDT_ERR_NOTFOUND) || (offset >= 0))
541 else if (offset == -FDT_ERR_BADOFFSET)
544 return offset; /* error from fdt_next_node() */
572 int offset;
583 for (offset = fdt_next_node(fdt, startoffset, NULL);
584 offset >= 0;
585 offset = fdt_next_node(fdt, offset, NULL)) {
586 val = fdt_getprop(fdt, offset, propname, &len);
589 return offset;
592 return offset; /* error from fdt_next_node() */
597 int offset;
610 for (offset = fdt_next_node(fdt, -1, NULL);
611 offset >= 0;
612 offset = fdt_next_node(fdt, offset, NULL)) {
613 if (fdt_get_phandle(fdt, offset) == phandle)
614 return offset;
617 return offset; /* error from fdt_next_node() */
753 int offset, err;
762 for (offset = fdt_next_node(fdt, startoffset, NULL);
763 offset >= 0;
764 offset = fdt_next_node(fdt, offset, NULL)) {
765 err = fdt_node_check_compatible(fdt, offset, compatible);
769 return offset;
772 return offset; /* error from fdt_next_node() */