[Crosstoolchain-logs] [device-tree-compiler] 13/22: libfdt: overlay: Fix symbols and fixups nodes condition

Hector Oron zumbi at moszumanska.debian.org
Thu Dec 8 17:07:26 UTC 2016


This is an automated email from the git hooks/post-receive script.

zumbi pushed a commit to branch upstream/latest
in repository device-tree-compiler.

commit 7a72d89d3f8112c1f4065d43e636aa572278f42e
Author: Maxime Ripard <maxime.ripard at free-electrons.com>
Date:   Thu Oct 6 13:39:58 2016 +0200

    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 at free-electrons.com>
    Signed-off-by: David Gibson <david at gibson.dropbear.id.au>
---
 libfdt/fdt_overlay.c | 7 +++----
 1 file 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) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/crosstoolchain/device-tree-compiler.git



More information about the Crosstoolchain-logs mailing list