]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - lib/libfdt/fdt.c
libfdt: Implement property iteration functions
[people/ms/u-boot.git] / lib / libfdt / fdt.c
index b09ea6f04d0a04abd14d32ab82da329783432b6e..4157b21efda2eb11585a0e1bf08d94cd8e754a24 100644 (file)
@@ -153,6 +153,15 @@ int _fdt_check_node_offset(const void *fdt, int offset)
        return offset;
 }
 
+int _fdt_check_prop_offset(const void *fdt, int offset)
+{
+       if ((offset < 0) || (offset % FDT_TAGSIZE)
+           || (fdt_next_tag(fdt, offset, &offset) != FDT_PROP))
+               return -FDT_ERR_BADOFFSET;
+
+       return offset;
+}
+
 int fdt_next_node(const void *fdt, int offset, int *depth)
 {
        int nextoffset = 0;