X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=tools%2Ffdtgrep.c;h=e373c43e3699e3d4387072f4dd89dfa061284ce6;hb=a6d4cd4778bcc30f451f2d5d92ec4722ff5b71cc;hp=67aa41a24de3a2da474331d64989ccba6109f8a4;hpb=60b25259a5540686add02cf6c94cd7494a3e2d23;p=platform%2Fkernel%2Fu-boot.git diff --git a/tools/fdtgrep.c b/tools/fdtgrep.c index 67aa41a..e373c43 100644 --- a/tools/fdtgrep.c +++ b/tools/fdtgrep.c @@ -405,7 +405,7 @@ static int display_fdt_by_regions(struct display_info *disp, const void *blob, * The output of this function may or may not be a valid FDT. To ensure it * is, these disp->flags must be set: * - * FDT_REG_SUPERNODES: ensures that subnodes are preceeded by their + * FDT_REG_SUPERNODES: ensures that subnodes are preceded by their * parents. Without this option, fragments of subnode data may be * output without the supernodes above them. This is useful for * hashing but cannot produce a valid FDT. @@ -660,6 +660,8 @@ static int fdtgrep_find_regions(const void *fdt, if (!ret) count++; } + if (ret && ret != -FDT_ERR_NOTFOUND) + return ret; /* Find all the aliases and add those regions back in */ if (disp->add_aliases && count < max_regions) { @@ -667,7 +669,11 @@ static int fdtgrep_find_regions(const void *fdt, new_count = fdt_add_alias_regions(fdt, region, count, max_regions, &state); - if (new_count <= max_regions) { + if (new_count == -FDT_ERR_NOTFOUND) { + /* No alias node found */ + } else if (new_count < 0) { + return new_count; + } else if (new_count <= max_regions) { /* * The alias regions will now be at the end of the list. * Sort the regions by offset to get things into the @@ -679,9 +685,6 @@ static int fdtgrep_find_regions(const void *fdt, } } - if (ret != -FDT_ERR_NOTFOUND) - return ret; - return count; }