diff mbox

[U-Boot] libfdt: fix return code of fdt_get_string_index()

Message ID 1436783124-31969-1-git-send-email-yamada.masahiro@socionext.com
State Superseded
Delegated to: Simon Glass
Headers show

Commit Message

Masahiro Yamada July 13, 2015, 10:25 a.m. UTC
As mentioned in the comment block in include/libfdt.h,
fdt_get_string_index() is supposed to return a negative value
on error.

BTW, looks like this function was added only for U-Boot in spite of
its location, so we need not send a bug report back to the DTC ML.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Fixes: commit 5094eb408a5d ("fdt: Add functions to retrieve strings")
---

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

Patch

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,