X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libfdt%2Ffdt_ro.c;h=11d80d2fa249d8a6085888e48b44130d6f7ca531;hb=10a3367955bc2033b288915f8f10d0e507fe2fa1;hp=f08941a7adecb6ac23beeb310b075c845f19d382;hpb=ae0b5908de3b9855f8931bc9b32c9fc4962df5a9;p=u-boot diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c index f08941a7ad..11d80d2fa2 100644 --- a/libfdt/fdt_ro.c +++ b/libfdt/fdt_ro.c @@ -50,18 +50,15 @@ */ #include "libfdt_env.h" +#ifndef USE_HOSTCC #include #include +#else +#include "fdt_host.h" +#endif #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) { @@ -460,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