Lines Matching refs:offset
109 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len) in fdt_offset_ptr() argument
111 unsigned absoffset = offset + fdt_off_dt_struct(fdt); in fdt_offset_ptr()
113 if ((absoffset < offset) in fdt_offset_ptr()
119 if (((offset + len) < offset) in fdt_offset_ptr()
120 || ((offset + len) > fdt_size_dt_struct(fdt))) in fdt_offset_ptr()
123 return fdt_offset_ptr_(fdt, offset); in fdt_offset_ptr()
130 int offset = startoffset; in fdt_next_tag() local
134 tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE); in fdt_next_tag()
138 offset += FDT_TAGSIZE; in fdt_next_tag()
145 p = fdt_offset_ptr(fdt, offset++, 1); in fdt_next_tag()
152 lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp)); in fdt_next_tag()
156 offset += sizeof(struct fdt_property) - FDT_TAGSIZE in fdt_next_tag()
159 ((offset - fdt32_to_cpu(*lenp)) % 8) != 0) in fdt_next_tag()
160 offset += 4; in fdt_next_tag()
172 if (!fdt_offset_ptr(fdt, startoffset, offset - startoffset)) in fdt_next_tag()
175 *nextoffset = FDT_TAGALIGN(offset); in fdt_next_tag()
179 int fdt_check_node_offset_(const void *fdt, int offset) in fdt_check_node_offset_() argument
181 if ((offset < 0) || (offset % FDT_TAGSIZE) in fdt_check_node_offset_()
182 || (fdt_next_tag(fdt, offset, &offset) != FDT_BEGIN_NODE)) in fdt_check_node_offset_()
185 return offset; in fdt_check_node_offset_()
188 int fdt_check_prop_offset_(const void *fdt, int offset) in fdt_check_prop_offset_() argument
190 if ((offset < 0) || (offset % FDT_TAGSIZE) in fdt_check_prop_offset_()
191 || (fdt_next_tag(fdt, offset, &offset) != FDT_PROP)) in fdt_check_prop_offset_()
194 return offset; in fdt_check_prop_offset_()
197 int fdt_next_node(const void *fdt, int offset, int *depth) in fdt_next_node() argument
202 if (offset >= 0) in fdt_next_node()
203 if ((nextoffset = fdt_check_node_offset_(fdt, offset)) < 0) in fdt_next_node()
207 offset = nextoffset; in fdt_next_node()
208 tag = fdt_next_tag(fdt, offset, &nextoffset); in fdt_next_node()
234 return offset; in fdt_next_node()
237 int fdt_first_subnode(const void *fdt, int offset) in fdt_first_subnode() argument
241 offset = fdt_next_node(fdt, offset, &depth); in fdt_first_subnode()
242 if (offset < 0 || depth != 1) in fdt_first_subnode()
245 return offset; in fdt_first_subnode()
248 int fdt_next_subnode(const void *fdt, int offset) in fdt_next_subnode() argument
257 offset = fdt_next_node(fdt, offset, &depth); in fdt_next_subnode()
258 if (offset < 0 || depth < 1) in fdt_next_subnode()
262 return offset; in fdt_next_subnode()