]> git.karo-electronics.de Git - karo-tx-uboot.git/commit
libfdt: fix error code of fdt_count_strings()
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 14 Jul 2015 16:08:44 +0000 (01:08 +0900)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 9 Sep 2015 11:34:20 +0000 (13:34 +0200)
commit9049aa3bb37f783f07ee947707dad0d10df91424
treeccd177baec85703e382bf4016ccf4c5d23f1c7f6
parent82f48e7261542dee716121d02f8b0d70c54cf862
libfdt: fix error code of fdt_count_strings()

Currently, this function returns a positive value on error,
so we never know whether this function has succeeded or failed.

For example, if the given property is not found, fdt_getprop()
returns -FDT_ERR_NOTFOUND, and then this function inverts it,
i.e., returns FDT_ERR_NOTFOUND (=1).

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Fixes: bc4147ab2d69 ("fdt: Add a function to count strings")
Acked-by: Simon Glass <sjg@chromium.org>
lib/libfdt/fdt_ro.c