Lines Matching refs:offset

77 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len)
79 unsigned absoffset = offset + fdt_off_dt_struct(fdt);
81 if ((absoffset < offset)
87 if (((offset + len) < offset)
88 || ((offset + len) > fdt_size_dt_struct(fdt)))
91 return fdt_offset_ptr_(fdt, offset);
98 int offset = startoffset;
102 tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE);
106 offset += FDT_TAGSIZE;
113 p = fdt_offset_ptr(fdt, offset++, 1);
120 lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp));
123 /* skip-name offset, length and value */
124 offset += sizeof(struct fdt_property) - FDT_TAGSIZE
127 ((offset - fdt32_to_cpu(*lenp)) % 8) != 0)
128 offset += 4;
140 if (!fdt_offset_ptr(fdt, startoffset, offset - startoffset))
143 *nextoffset = FDT_TAGALIGN(offset);
147 int fdt_check_node_offset_(const void *fdt, int offset)
149 if ((offset < 0) || (offset % FDT_TAGSIZE)
150 || (fdt_next_tag(fdt, offset, &offset) != FDT_BEGIN_NODE))
153 return offset;
156 int fdt_check_prop_offset_(const void *fdt, int offset)
158 if ((offset < 0) || (offset % FDT_TAGSIZE)
159 || (fdt_next_tag(fdt, offset, &offset) != FDT_PROP))
162 return offset;
165 int fdt_next_node(const void *fdt, int offset, int *depth)
170 if (offset >= 0)
171 if ((nextoffset = fdt_check_node_offset_(fdt, offset)) < 0)
175 offset = nextoffset;
176 tag = fdt_next_tag(fdt, offset, &nextoffset);
202 return offset;
205 int fdt_first_subnode(const void *fdt, int offset)
209 offset = fdt_next_node(fdt, offset, &depth);
210 if (offset < 0 || depth != 1)
213 return offset;
216 int fdt_next_subnode(const void *fdt, int offset)
225 offset = fdt_next_node(fdt, offset, &depth);
226 if (offset < 0 || depth < 1)
230 return offset;