Lines Matching refs:offset
135 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len) in fdt_offset_ptr() argument
137 unsigned int uoffset = offset; in fdt_offset_ptr()
138 unsigned int absoffset = offset + fdt_off_dt_struct(fdt); in fdt_offset_ptr()
140 if (offset < 0) in fdt_offset_ptr()
151 || ((offset + len) > fdt_size_dt_struct(fdt))) in fdt_offset_ptr()
154 return fdt_offset_ptr_(fdt, offset); in fdt_offset_ptr()
161 int offset = startoffset; in fdt_next_tag() local
165 tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE); in fdt_next_tag()
169 offset += FDT_TAGSIZE; in fdt_next_tag()
176 p = fdt_offset_ptr(fdt, offset++, 1); in fdt_next_tag()
183 lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp)); in fdt_next_tag()
187 offset += sizeof(struct fdt_property) - FDT_TAGSIZE in fdt_next_tag()
191 ((offset - fdt32_to_cpu(*lenp)) % 8) != 0) in fdt_next_tag()
192 offset += 4; in fdt_next_tag()
204 if (!fdt_offset_ptr(fdt, startoffset, offset - startoffset)) in fdt_next_tag()
207 *nextoffset = FDT_TAGALIGN(offset); in fdt_next_tag()
211 int fdt_check_node_offset_(const void *fdt, int offset) in fdt_check_node_offset_() argument
214 && ((offset < 0) || (offset % FDT_TAGSIZE))) in fdt_check_node_offset_()
217 if (fdt_next_tag(fdt, offset, &offset) != FDT_BEGIN_NODE) in fdt_check_node_offset_()
220 return offset; in fdt_check_node_offset_()
223 int fdt_check_prop_offset_(const void *fdt, int offset) in fdt_check_prop_offset_() argument
226 && ((offset < 0) || (offset % FDT_TAGSIZE))) in fdt_check_prop_offset_()
229 if (fdt_next_tag(fdt, offset, &offset) != FDT_PROP) in fdt_check_prop_offset_()
232 return offset; in fdt_check_prop_offset_()
235 int fdt_next_node(const void *fdt, int offset, int *depth) in fdt_next_node() argument
240 if (offset >= 0) in fdt_next_node()
241 if ((nextoffset = fdt_check_node_offset_(fdt, offset)) < 0) in fdt_next_node()
245 offset = nextoffset; in fdt_next_node()
246 tag = fdt_next_tag(fdt, offset, &nextoffset); in fdt_next_node()
272 return offset; in fdt_next_node()
275 int fdt_first_subnode(const void *fdt, int offset) in fdt_first_subnode() argument
279 offset = fdt_next_node(fdt, offset, &depth); in fdt_first_subnode()
280 if (offset < 0 || depth != 1) in fdt_first_subnode()
283 return offset; in fdt_first_subnode()
286 int fdt_next_subnode(const void *fdt, int offset) in fdt_next_subnode() argument
295 offset = fdt_next_node(fdt, offset, &depth); in fdt_next_subnode()
296 if (offset < 0 || depth < 1) in fdt_next_subnode()
300 return offset; in fdt_next_subnode()