From patchwork Sun Sep 25 21:52:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 674734 X-Patchwork-Delegate: sjg@chromium.org 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 3sj17P1sT0z9s5g for ; Mon, 26 Sep 2016 07:53:21 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=X8l/u2es; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7492FA76E2; Sun, 25 Sep 2016 23:53:02 +0200 (CEST) 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 W-otrE6F99VZ; Sun, 25 Sep 2016 23:53:02 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 20314A7718; Sun, 25 Sep 2016 23:52:48 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7E32DA76AD for ; Sun, 25 Sep 2016 23:52:39 +0200 (CEST) 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 2iM2Ze7sdLTb for ; Sun, 25 Sep 2016 23:52:39 +0200 (CEST) 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-io0-f171.google.com (mail-io0-f171.google.com [209.85.223.171]) by theia.denx.de (Postfix) with ESMTPS id 11442A768F for ; Sun, 25 Sep 2016 23:52:35 +0200 (CEST) Received: by mail-io0-f171.google.com with SMTP id m186so165181692ioa.2 for ; Sun, 25 Sep 2016 14:52:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=VtnEvN2RDl9DTfL5k3+dhxrZHjoh4bEngBAziAO6JXg=; b=X8l/u2esP+fCf1+vbRk6t6oSciXuKq9u5+zgcL2mpC12/CGwXAtPJQUGasOAxpt8o8 uARl8CGJENMuabIQZMNF6qXXeQFVrlYWYL0yZRPh8f0B+t5xK9hJYAg2YD6G3bzdm6Nd UAux5iToYqrOj1Pak4mDbj9jHyVgiMLe5HyXJ1VuU56dlie4i+cpmeid0f7Z9HbAdyGp mPUcT7UuSDOVi62SCyr2YM7nYGje7hfg2j0UE5oato3PAiSTuMujr04PQ/HimvegMyF/ 0IXjtuqcPOB0n6ZwQgF/1NE/F4uN/GCMKDUfBV2sFc5QZp43BsmPnFDhliiIK1+F2BvB IdRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=VtnEvN2RDl9DTfL5k3+dhxrZHjoh4bEngBAziAO6JXg=; b=ep9Fdk5VLjc1/azjJmY2fyIocnqBIYCz6ZkKRD1/FbclnK7wbwcY93C9EqVZlhwM9w tRX9qjUeIrAe+Ad7xCjaQ1SJUEkROgwPnQTVEqVErVprpiWdKwPRdDbygPZp0sTT8NdC QD+M2HvOj4PlsfXdZWo7S1mC1HsOmWDtJHkjAbooO0ORY8Zj1hBQ4iuHJcZmOP2Jhx9q ubvGkHJNHR0mO4jGe+yx/7Mog4gJ+UpNk3GdaAHVquLSUY1XbT7qzgsjviZjZKShzX/J yEHEPUVRNuTLRfWAg0d+pxMNVFhVgt1pdj9eU8AzQ5Vyy+dVtnnNf47BYfJPVMR3xImm 97uA== X-Gm-Message-State: AA6/9RkzMqmfbwgHlQ5nAHcvQ4kXNk5XW11hFRNBxnSgdxGap2+2ci0Xu1g+Gk3R9mxExi/j X-Received: by 10.107.164.102 with SMTP id n99mr15577438ioe.182.1474840354355; Sun, 25 Sep 2016 14:52:34 -0700 (PDT) Received: from kaki.bld.corp.google.com ([2620:0:1005:12:61b7:f33c:9010:eb01]) by smtp.gmail.com with ESMTPSA id e66sm2674759itd.22.2016.09.25.14.52.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Sep 2016 14:52:32 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 2BB8622104F; Sun, 25 Sep 2016 15:52:31 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Sun, 25 Sep 2016 15:52:18 -0600 Message-Id: <1474840348-22780-3-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1474840348-22780-1-git-send-email-sjg@chromium.org> References: <1474840348-22780-1-git-send-email-sjg@chromium.org> Cc: Tom Rini Subject: [U-Boot] [PATCH v2 02/12] dtoc: Adjust GetProps() in fdt_normal to use the node path 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" There is no need to pass a node path separately. Instead we should use the path for the node provided. Correct this. Signed-off-by: Simon Glass --- Changes in v2: - Add new patch to adjust GetProps() in fdt_normal to use the node path tools/dtoc/fdt_normal.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/dtoc/fdt_normal.py b/tools/dtoc/fdt_normal.py index aae258e..cce5c06 100644 --- a/tools/dtoc/fdt_normal.py +++ b/tools/dtoc/fdt_normal.py @@ -81,7 +81,7 @@ class Node(NodeBase): This fills in the props and subnodes properties, recursively searching into subnodes so that the entire tree is built. """ - self.props = self._fdt.GetProps(self, self.path) + self.props = self._fdt.GetProps(self) offset = libfdt.fdt_first_subnode(self._fdt.GetFdt(), self.Offset()) while offset >= 0: @@ -159,7 +159,7 @@ class FdtNormal(Fdt): fdt_len = libfdt.fdt_totalsize(self._fdt) del self._fdt[fdt_len:] - def GetProps(self, node, path): + def GetProps(self, node): """Get all properties from a node. Args: @@ -172,11 +172,8 @@ class FdtNormal(Fdt): Raises: ValueError: if the node does not exist. """ - offset = libfdt.fdt_path_offset(self._fdt, path) - if offset < 0: - libfdt.Raise(offset) props_dict = {} - poffset = libfdt.fdt_first_property_offset(self._fdt, offset) + poffset = libfdt.fdt_first_property_offset(self._fdt, node._offset) while poffset >= 0: dprop, plen = libfdt.fdt_get_property_by_offset(self._fdt, poffset) prop = Prop(node, poffset, libfdt.String(self._fdt, dprop.nameoff),