diff options
Diffstat (limited to 'tools/dtoc/fdt.py')
-rw-r--r-- | tools/dtoc/fdt.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py index 026f7a273f9..f69f89cd783 100644 --- a/tools/dtoc/fdt.py +++ b/tools/dtoc/fdt.py @@ -548,6 +548,23 @@ class Node: self.subnodes.append(subnode) return subnode + def Delete(self): + """Delete a node + + The node is deleted and the offset cache is invalidated. + + Args: + node (Node): Node to delete + + Raises: + ValueError if the node does not exist + """ + CheckErr(self._fdt._fdt_obj.del_node(self.Offset()), + "Node '%s': delete" % self.path) + parent = self.parent + self._fdt.Invalidate() + parent.subnodes.remove(self) + def Sync(self, auto_resize=False): """Sync node changes back to the device tree |