Commit 8828254cae24abfc5de9f84d79c570fb8edde354

Authored by Simon Glass
Committed by sjg
1 parent 0734b70c9c

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: Simon Glass <sjg@chromium.org>

Showing 1 changed file with 3 additions and 6 deletions Side-by-side Diff

tools/dtoc/fdt_normal.py
... ... @@ -81,7 +81,7 @@
81 81 This fills in the props and subnodes properties, recursively
82 82 searching into subnodes so that the entire tree is built.
83 83 """
84   - self.props = self._fdt.GetProps(self, self.path)
  84 + self.props = self._fdt.GetProps(self)
85 85  
86 86 offset = libfdt.fdt_first_subnode(self._fdt.GetFdt(), self.Offset())
87 87 while offset >= 0:
... ... @@ -159,7 +159,7 @@
159 159 fdt_len = libfdt.fdt_totalsize(self._fdt)
160 160 del self._fdt[fdt_len:]
161 161  
162   - def GetProps(self, node, path):
  162 + def GetProps(self, node):
163 163 """Get all properties from a node.
164 164  
165 165 Args:
166 166  
... ... @@ -172,11 +172,8 @@
172 172 Raises:
173 173 ValueError: if the node does not exist.
174 174 """
175   - offset = libfdt.fdt_path_offset(self._fdt, path)
176   - if offset < 0:
177   - libfdt.Raise(offset)
178 175 props_dict = {}
179   - poffset = libfdt.fdt_first_property_offset(self._fdt, offset)
  176 + poffset = libfdt.fdt_first_property_offset(self._fdt, node._offset)
180 177 while poffset >= 0:
181 178 dprop, plen = libfdt.fdt_get_property_by_offset(self._fdt, poffset)
182 179 prop = Prop(node, poffset, libfdt.String(self._fdt, dprop.nameoff),