diff --git a/fdt.c b/fdt.c index 45568b1..772da46 100644 --- a/fdt.c +++ b/fdt.c @@ -83,7 +83,7 @@ uint32_t _fdt_next_tag(const void *fdt, int offset, int *nextoffset) return FDT_END; break; case FDT_PROP: - lenp = fdt_offset_ptr(fdt, offset + FDT_TAGSIZE, sizeof(*lenp)); + lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp)); if (! lenp) return FDT_END; /* skip name offset, length and value */ diff --git a/fdt.h b/fdt.h index fff533e..4687a31 100644 --- a/fdt.h +++ b/fdt.h @@ -36,8 +36,8 @@ struct fdt_node_header { struct fdt_property { uint32_t tag; - uint32_t nameoff; uint32_t len; + uint32_t nameoff; char data[0]; }; diff --git a/tests/trees.S b/tests/trees.S index 397c151..6057668 100644 --- a/tests/trees.S +++ b/tests/trees.S @@ -39,8 +39,8 @@ tree: \ #define PROPHDR(tree, name, len) \ FDTLONG(FDT_PROP) ; \ - FDTLONG(tree##_##name - tree##_strings) ; \ - FDTLONG(len) ; + FDTLONG(len) ; \ + FDTLONG(tree##_##name - tree##_strings) ; #define PROP_INT(tree, name, val) \ PROPHDR(tree, name, 4) \