Lines Matching refs:offset

154 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len)
156 unsigned absoffset = offset + fdt_off_dt_struct(fdt);
158 if ((absoffset < offset)
164 if (((offset + len) < offset)
165 || ((offset + len) > fdt_size_dt_struct(fdt)))
168 return fdt_offset_ptr_(fdt, offset);
175 int offset = startoffset;
179 tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE);
183 offset += FDT_TAGSIZE;
190 p = fdt_offset_ptr(fdt, offset++, 1);
197 lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp));
200 /* skip-name offset, length and value */
201 offset += sizeof(struct fdt_property) - FDT_TAGSIZE
204 ((offset - fdt32_to_cpu(*lenp)) % 8) != 0)
205 offset += 4;
217 if (!fdt_offset_ptr(fdt, startoffset, offset - startoffset))
220 *nextoffset = FDT_TAGALIGN(offset);
224 int fdt_check_node_offset_(const void *fdt, int offset)
226 if ((offset < 0) || (offset % FDT_TAGSIZE)
227 || (fdt_next_tag(fdt, offset, &offset) != FDT_BEGIN_NODE))
230 return offset;
233 int fdt_check_prop_offset_(const void *fdt, int offset)
235 if ((offset < 0) || (offset % FDT_TAGSIZE)
236 || (fdt_next_tag(fdt, offset, &offset) != FDT_PROP))
239 return offset;
242 int fdt_next_node(const void *fdt, int offset, int *depth)
247 if (offset >= 0)
248 if ((nextoffset = fdt_check_node_offset_(fdt, offset)) < 0)
252 offset = nextoffset;
253 tag = fdt_next_tag(fdt, offset, &nextoffset);
279 return offset;
282 int fdt_first_subnode(const void *fdt, int offset)
286 offset = fdt_next_node(fdt, offset, &depth);
287 if (offset < 0 || depth != 1)
290 return offset;
293 int fdt_next_subnode(const void *fdt, int offset)
302 offset = fdt_next_node(fdt, offset, &depth);
303 if (offset < 0 || depth < 1)
307 return offset;