]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
libfdt: fix error code of fdt_get_string_index()
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 14 Jul 2015 16:08:43 +0000 (01:08 +0900)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 9 Sep 2015 11:34:20 +0000 (13:34 +0200)
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 <yamada.masahiro@socionext.com>
Fixes: 5094eb408a5d ("fdt: Add functions to retrieve strings")
Acked-by: Simon Glass <sjg@chromium.org>
lib/libfdt/fdt_ro.c

index 44fc0aa900d2556996ab5f9ef7c87f12fca517ce..38bfcbdcd53d2b4d150b429e6fe38ddbfb1a91a4 100644 (file)
@@ -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,