From: Masahiro Yamada Date: Tue, 14 Jul 2015 16:08:43 +0000 (+0900) Subject: libfdt: fix error code of fdt_get_string_index() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=31f334abc516a37257d09c4492808f3238e129fa;p=u-boot.git libfdt: fix error code of fdt_get_string_index() As mentioned in the comment block in include/libfdt.h, fdt_get_string_index() is supposed to return a negative value on error. Signed-off-by: Masahiro Yamada Fixes: 5094eb408a5d ("fdt: Add functions to retrieve strings") Acked-by: Simon Glass --- diff --git a/lib/libfdt/fdt_ro.c b/lib/libfdt/fdt_ro.c index 44fc0aa900..38bfcbdcd5 100644 --- a/lib/libfdt/fdt_ro.c +++ b/lib/libfdt/fdt_ro.c @@ -577,7 +577,7 @@ int fdt_get_string_index(const void *fdt, int node, const char *property, index--; } - return FDT_ERR_NOTFOUND; + return -FDT_ERR_NOTFOUND; } int fdt_get_string(const void *fdt, int node, const char *property,