dtoc: Update Fdt.GetNode() to handle the root node
This function currently fails if the root node is requested. Requesting
the root node is sometimes useful, so fix the bug.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py
index b341ef3..cd7673c 100644
--- a/tools/dtoc/fdt.py
+++ b/tools/dtoc/fdt.py
@@ -574,6 +574,8 @@
parts = path.split('/')
if len(parts) < 2:
return None
+ if len(parts) == 2 and parts[1] == '':
+ return node
for part in parts[1:]:
node = node.FindNode(part)
if not node: