Skip to content
Snippets Groups Projects
Commit 8828254c authored by Simon Glass's avatar Simon Glass Committed by sjg
Browse files

dtoc: Adjust GetProps() in fdt_normal to use the node path


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: default avatarSimon Glass <sjg@chromium.org>
parent 0734b70c
No related branches found
No related tags found
No related merge requests found
...@@ -81,7 +81,7 @@ class Node(NodeBase): ...@@ -81,7 +81,7 @@ class Node(NodeBase):
This fills in the props and subnodes properties, recursively This fills in the props and subnodes properties, recursively
searching into subnodes so that the entire tree is built. 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()) offset = libfdt.fdt_first_subnode(self._fdt.GetFdt(), self.Offset())
while offset >= 0: while offset >= 0:
...@@ -159,7 +159,7 @@ class FdtNormal(Fdt): ...@@ -159,7 +159,7 @@ class FdtNormal(Fdt):
fdt_len = libfdt.fdt_totalsize(self._fdt) fdt_len = libfdt.fdt_totalsize(self._fdt)
del self._fdt[fdt_len:] del self._fdt[fdt_len:]
def GetProps(self, node, path): def GetProps(self, node):
"""Get all properties from a node. """Get all properties from a node.
Args: Args:
...@@ -172,11 +172,8 @@ class FdtNormal(Fdt): ...@@ -172,11 +172,8 @@ class FdtNormal(Fdt):
Raises: Raises:
ValueError: if the node does not exist. ValueError: if the node does not exist.
""" """
offset = libfdt.fdt_path_offset(self._fdt, path)
if offset < 0:
libfdt.Raise(offset)
props_dict = {} props_dict = {}
poffset = libfdt.fdt_first_property_offset(self._fdt, offset) poffset = libfdt.fdt_first_property_offset(self._fdt, node._offset)
while poffset >= 0: while poffset >= 0:
dprop, plen = libfdt.fdt_get_property_by_offset(self._fdt, poffset) dprop, plen = libfdt.fdt_get_property_by_offset(self._fdt, poffset)
prop = Prop(node, poffset, libfdt.String(self._fdt, dprop.nameoff), prop = Prop(node, poffset, libfdt.String(self._fdt, dprop.nameoff),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment