X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=tools%2Ffdtgrep.c;h=8d33205ea2a0938f2ca073c8de1f916b392330e0;hb=b2a3372138c468c5c749c50c368dd6c11313e491;hp=e373c43e3699e3d4387072f4dd89dfa061284ce6;hpb=bdf1ea11c8d8789bf95a284d6c980eafea13d94c;p=people%2Fms%2Fu-boot.git diff --git a/tools/fdtgrep.c b/tools/fdtgrep.c index e373c43e36..8d33205ea2 100644 --- a/tools/fdtgrep.c +++ b/tools/fdtgrep.c @@ -10,14 +10,17 @@ #include #include +#include #include +#include +#include #include #include #include #include -#include <../include/libfdt.h> -#include +#include "fdt_host.h" +#include "libfdt_internal.h" /* Define DEBUG to get some debugging output on stderr */ #ifdef DEBUG @@ -522,18 +525,21 @@ static int check_type_include(void *priv, int type, const char *data, int size) * return 1 at the first match. For exclusive conditions, we must * check that there are no matches. */ - for (val = disp->value_head; val; val = val->next) { - if (!(type & val->type)) - continue; - match = fdt_stringlist_contains(data, size, val->string); - debug(" - val->type=%x, str='%s', match=%d\n", - val->type, val->string, match); - if (match && val->include) { - debug(" - match inc %s\n", val->string); - return 1; + if (data) { + for (val = disp->value_head; val; val = val->next) { + if (!(type & val->type)) + continue; + match = fdt_stringlist_contains(data, size, + val->string); + debug(" - val->type=%x, str='%s', match=%d\n", + val->type, val->string, match); + if (match && val->include) { + debug(" - match inc %s\n", val->string); + return 1; + } + if (match) + none_match &= ~val->type; } - if (match) - none_match &= ~val->type; } /*