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.masah...@socionext.com>
Fixes: 5094eb408a5d ("fdt: Add functions to retrieve strings")
---

Changes in v2:
  - minor fix in git-log (drop "commit")
  - return code -> error code

 lib/libfdt/fdt_ro.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/libfdt/fdt_ro.c b/lib/libfdt/fdt_ro.c
index 44fc0aa..38bfcbd 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,
-- 
1.9.1

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to