]> git.sur5r.net Git - u-boot/blobdiff - libfdt/fdt_ro.c
Merge branch 'new-image' of git://www.denx.de/git/u-boot-testing
[u-boot] / libfdt / fdt_ro.c
index 031a15f4715b2cc22910f1ab0939ec99b00798db..11d80d2fa249d8a6085888e48b44130d6f7ca531 100644 (file)
 
 #include "libfdt_internal.h"
 
-#define CHECK_HEADER(fdt) \
-       { \
-               int err; \
-               if ((err = fdt_check_header(fdt)) != 0) \
-                       return err; \
-       }
-
 static int nodename_eq(const void *fdt, int offset,
                       const char *s, int len)
 {
@@ -464,20 +457,10 @@ int fdt_node_check_compatible(const void *fdt, int nodeoffset,
 int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
                                  const char *compatible)
 {
-       uint32_t tag;
-       int offset, nextoffset;
-       int err;
+       int offset, err;
 
        CHECK_HEADER(fdt);
 
-       if (startoffset >= 0) {
-               tag = fdt_next_tag(fdt, startoffset, &nextoffset);
-               if (tag != FDT_BEGIN_NODE)
-                       return -FDT_ERR_BADOFFSET;
-       } else {
-               nextoffset = 0;
-       }
-
        /* FIXME: The algorithm here is pretty horrible: we scan each
         * property of a node in fdt_node_check_compatible(), then if
         * that didn't find what we want, we scan over them again