summaryrefslogtreecommitdiff
path: root/tools/dtoc/test_src_scan.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-02-03 06:01:11 -0700
committerSimon Glass <sjg@chromium.org>2021-03-22 19:23:27 +1300
commit50aae3e62d57931afcafec7eb973f222cb3131c7 (patch)
tree3134e1b2b7911642191b5bb3f2d8b318853a004d /tools/dtoc/test_src_scan.py
parent337d6972f5f5294971db52809f83c0454cb4e7ba (diff)
dtoc: Support processing the root node
The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc/test_src_scan.py')
-rw-r--r--tools/dtoc/test_src_scan.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/dtoc/test_src_scan.py b/tools/dtoc/test_src_scan.py
index d32aa58400f..0af86dcf0c3 100644
--- a/tools/dtoc/test_src_scan.py
+++ b/tools/dtoc/test_src_scan.py
@@ -161,6 +161,10 @@ class TestSrcScan(unittest.TestCase):
prop.value = 'rockchip,rk3288-grf'
node = FakeNode()
node.props = {'compatible': prop}
+
+ # get_normalized_compat_name() uses this to check for root node
+ node.parent = FakeNode()
+
scan = src_scan.Scanner(None, False, None)
with test_util.capture_sys_output() as (stdout, _):
name, aliases = scan.get_normalized_compat_name(node)
@@ -419,6 +423,9 @@ U_BOOT_DRIVER(%s) = {
node.name = 'testing'
node.props = {'compatible': prop}
+ # get_normalized_compat_name() uses this to check for root node
+ node.parent = FakeNode()
+
return scan, drv1, driver2, node
def test_dup_drivers(self):