Lines Matching refs:offset
139 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len) in fdt_offset_ptr() argument
141 unsigned int uoffset = offset; in fdt_offset_ptr()
142 unsigned int absoffset = offset + fdt_off_dt_struct(fdt); in fdt_offset_ptr()
144 if (offset < 0) in fdt_offset_ptr()
155 || ((offset + len) > fdt_size_dt_struct(fdt))) in fdt_offset_ptr()
158 return fdt_offset_ptr_(fdt, offset); in fdt_offset_ptr()
165 int offset = startoffset; in fdt_next_tag() local
169 tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE); in fdt_next_tag()
173 offset += FDT_TAGSIZE; in fdt_next_tag()
180 p = fdt_offset_ptr(fdt, offset++, 1); in fdt_next_tag()
187 lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp)); in fdt_next_tag()
191 offset += sizeof(struct fdt_property) - FDT_TAGSIZE in fdt_next_tag()
195 ((offset - fdt32_to_cpu(*lenp)) % 8) != 0) in fdt_next_tag()
196 offset += 4; in fdt_next_tag()
208 if (!fdt_offset_ptr(fdt, startoffset, offset - startoffset)) in fdt_next_tag()
211 *nextoffset = FDT_TAGALIGN(offset); in fdt_next_tag()
215 int fdt_check_node_offset_(const void *fdt, int offset) in fdt_check_node_offset_() argument
218 && ((offset < 0) || (offset % FDT_TAGSIZE))) in fdt_check_node_offset_()
221 if (fdt_next_tag(fdt, offset, &offset) != FDT_BEGIN_NODE) in fdt_check_node_offset_()
224 return offset; in fdt_check_node_offset_()
227 int fdt_check_prop_offset_(const void *fdt, int offset) in fdt_check_prop_offset_() argument
230 && ((offset < 0) || (offset % FDT_TAGSIZE))) in fdt_check_prop_offset_()
233 if (fdt_next_tag(fdt, offset, &offset) != FDT_PROP) in fdt_check_prop_offset_()
236 return offset; in fdt_check_prop_offset_()
239 int fdt_next_node(const void *fdt, int offset, int *depth) in fdt_next_node() argument
244 if (offset >= 0) in fdt_next_node()
245 if ((nextoffset = fdt_check_node_offset_(fdt, offset)) < 0) in fdt_next_node()
249 offset = nextoffset; in fdt_next_node()
250 tag = fdt_next_tag(fdt, offset, &nextoffset); in fdt_next_node()
276 return offset; in fdt_next_node()
279 int fdt_first_subnode(const void *fdt, int offset) in fdt_first_subnode() argument
283 offset = fdt_next_node(fdt, offset, &depth); in fdt_first_subnode()
284 if (offset < 0 || depth != 1) in fdt_first_subnode()
287 return offset; in fdt_first_subnode()
290 int fdt_next_subnode(const void *fdt, int offset) in fdt_next_subnode() argument
299 offset = fdt_next_node(fdt, offset, &depth); in fdt_next_subnode()
300 if (offset < 0 || depth < 1) in fdt_next_subnode()
304 return offset; in fdt_next_subnode()