diff mbox

[U-Boot,v2,02/12] dtoc: Adjust GetProps() in fdt_normal to use the node path

Message ID 1474840348-22780-3-git-send-email-sjg@chromium.org
State Accepted
Commit 8828254cae24abfc5de9f84d79c570fb8edde354
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Sept. 25, 2016, 9:52 p.m. UTC
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 <sjg@chromium.org>
---

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(-)

Comments

Simon Glass Oct. 2, 2016, 5:58 p.m. UTC | #1
On 25 September 2016 at 15:52, Simon Glass <sjg@chromium.org> wrote:
> 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 <sjg@chromium.org>
> ---
>
> 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(-)

Applied to u-boot-dm
diff mbox

Patch

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),