소스 검색

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 <yamada.masahiro@socionext.com>
Fixes: 5094eb408a5d ("fdt: Add functions to retrieve strings")
Acked-by: Simon Glass <sjg@chromium.org>
Masahiro Yamada 10 년 전
부모
커밋
31f334abc5
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      lib/libfdt/fdt_ro.c

+ 1 - 1
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,