From patchwork Thu Dec 15 23:03:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 706291 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3tfps81XSSz9snk for ; Fri, 16 Dec 2016 10:03:39 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=agner.ch header.i=@agner.ch header.b="Y6WPI5+T"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EB3ADA75AC; Fri, 16 Dec 2016 00:03:33 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a8cKKVt7Ytwn; Fri, 16 Dec 2016 00:03:33 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4F34D4BA35; Fri, 16 Dec 2016 00:03:33 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C85444BDBD for ; Fri, 16 Dec 2016 00:03:30 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lhLfI4WR99Wb for ; Fri, 16 Dec 2016 00:03:30 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail.kmu-office.ch (mail.kmu-office.ch [178.209.48.109]) by theia.denx.de (Postfix) with ESMTPS id 8B8BD4B656 for ; Fri, 16 Dec 2016 00:03:26 +0100 (CET) Received: from trochilidae.toradex.int (75-146-58-181-Washington.hfc.comcastbusiness.net [75.146.58.181]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 6BE445C0599; Thu, 15 Dec 2016 23:55:39 +0100 (CET) From: Stefan Agner To: u-boot@lists.denx.de, Maxime Ripard Date: Thu, 15 Dec 2016 15:03:26 -0800 Message-Id: <20161215230327.28896-1-stefan@agner.ch> X-Mailer: git-send-email 2.10.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1481842540; bh=rNwNS3tU1T6njymt0bIuJE7/YyQH2/nxxttcQpCBSZ8=; h=From:To:Cc:Subject:Date:Message-Id; b=Y6WPI5+T6SnTQr7LUuhSF4DGHCKlTYqaKtfzxBciNXD8WBCHeU4BGOvQVfiewNHikFihY9n2QaSw5j3FlO44O1S0G8xoK5LzmQg5Lb8iegkTkeu9bKHle/vHx01T2cAqBazX9rF6Lu/qmOnkLrdmfWeP48KUX0VkDVMboQlTgHY= Cc: Stefan Agner Subject: [U-Boot] [PATCH 1/2] libfdt: overlay: Fix missing symbols condition X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Stefan Agner When there is no symbols section in the device tree, overlay_fixup_phandles should return FDT_ERR_NOTFOUND instead of FDT_ERR_BADOFFSET. Signed-off-by: Stefan Agner --- lib/libfdt/fdt_overlay.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libfdt/fdt_overlay.c b/lib/libfdt/fdt_overlay.c index bb41404..4a9ba40 100644 --- a/lib/libfdt/fdt_overlay.c +++ b/lib/libfdt/fdt_overlay.c @@ -495,9 +495,9 @@ static int overlay_fixup_phandles(void *fdt, void *fdto) if ((fixups_off < 0 && (fixups_off != -FDT_ERR_NOTFOUND))) return fixups_off; - /* And base DTs without symbols */ + /* But if we need to fixup phandles, symbols are required */ symbols_off = fdt_path_offset(fdt, "/__symbols__"); - if ((symbols_off < 0 && (symbols_off != -FDT_ERR_NOTFOUND))) + if (symbols_off < 0) return symbols_off; fdt_for_each_property_offset(property, fdto, fixups_off) {