aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2016-10-06 13:39:58 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2016-10-07 12:28:58 +1100
commit7a72d89d3f8112c1f4065d43e636aa572278f42e (patch)
tree61f1c56b56238c5e54a0603305ed1ac60226bea1
parentcabbaa972cddb193dbe170f3797825a5d4ca66fa (diff)
downloaddtc-7a72d89d3f8112c1f4065d43e636aa572278f42e.zip
dtc-7a72d89d3f8112c1f4065d43e636aa572278f42e.tar.gz
dtc-7a72d89d3f8112c1f4065d43e636aa572278f42e.tar.bz2
libfdt: overlay: Fix symbols and fixups nodes condition
Some base device tree might not have any __symbols__ nodes, since they might not have any phandle at all. Similarly, if an overlay doesn't use any base device tree phandles, its __fixups__ node will be empty. In such cases, we don't want to stop the phandle parsing, but rather just ignore the error reported about the missing node. If it's actually an issue for the overlay we're trying to apply on a given base device tree, it will be caught later on, but we cannot make the assumption that early in the application process. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r--libfdt/fdt_overlay.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libfdt/fdt_overlay.c b/libfdt/fdt_overlay.c
index 2f306e4..bb41404 100644
--- a/libfdt/fdt_overlay.c
+++ b/libfdt/fdt_overlay.c
@@ -492,13 +492,12 @@ static int overlay_fixup_phandles(void *fdt, void *fdto)
/* We can have overlays without any fixups */
fixups_off = fdt_path_offset(fdto, "/__fixups__");
- if (fixups_off == -FDT_ERR_NOTFOUND)
- return 0;
- if (fixups_off < 0)
+ if ((fixups_off < 0 && (fixups_off != -FDT_ERR_NOTFOUND)))
return fixups_off;
+ /* And base DTs without symbols */
symbols_off = fdt_path_offset(fdt, "/__symbols__");
- if (symbols_off < 0)
+ if ((symbols_off < 0 && (symbols_off != -FDT_ERR_NOTFOUND)))
return symbols_off;
fdt_for_each_property_offset(property, fdto, fixups_off) {