diff options
author | Simon Glass <sjg@chromium.org> | 2016-10-02 17:59:27 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-10-13 13:54:10 -0600 |
commit | 9c07b9877cf07a1a971a79ed7c2369a58c0baca2 (patch) | |
tree | 916710a42689cef60b0e8725b415932c5c90eefe /lib/libfdt/fdt_ro.c | |
parent | 491c7b6f42a8101f1e84cf8e13a0e23b5eca729e (diff) | |
download | u-boot-9c07b9877cf07a1a971a79ed7c2369a58c0baca2.tar.gz u-boot-9c07b9877cf07a1a971a79ed7c2369a58c0baca2.tar.bz2 u-boot-9c07b9877cf07a1a971a79ed7c2369a58c0baca2.zip |
libfdt: Sync up with upstream
This includes small changes to the following functions, from upstream
commit 6d1832c:
- fdt_get_max_phandle() (upstream commit 84e0e134)
- fdt_node_check_compatible (upstream commit 53bf130b)
- fdt_setprop_inplace_namelen_partial() to remove useless brackets and
use idx instead of index
- _fdt_resize_property() to use idx instead of index
- _fdt_splice() (upstream commit d4c7c25c)
It also includes various typo fixes in libfdt.h
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib/libfdt/fdt_ro.c')
-rw-r--r-- | lib/libfdt/fdt_ro.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/libfdt/fdt_ro.c b/lib/libfdt/fdt_ro.c index 9cc98db6e2..005f26736f 100644 --- a/lib/libfdt/fdt_ro.c +++ b/lib/libfdt/fdt_ro.c @@ -60,11 +60,11 @@ uint32_t fdt_get_max_phandle(const void *fdt) return max_phandle; if (offset < 0) - return 0; + return (uint32_t)-1; phandle = fdt_get_phandle(fdt, offset); if (phandle == (uint32_t)-1) - return 0; + continue; if (phandle > max_phandle) max_phandle = phandle; @@ -623,10 +623,8 @@ int fdt_node_check_compatible(const void *fdt, int nodeoffset, prop = fdt_getprop(fdt, nodeoffset, "compatible", &len); if (!prop) return len; - if (fdt_stringlist_contains(prop, len, compatible)) - return 0; - else - return 1; + + return !fdt_stringlist_contains(prop, len, compatible); } int fdt_node_offset_by_compatible(const void *fdt, int startoffset, |