From cce29cdc722a67abfa4303951ae3a0d133764b05 Mon Sep 17 00:00:00 2001 From: Piotr Wojnarowski Date: Tue, 11 Apr 2023 21:34:21 +0200 Subject: [PATCH] [#41544] Prefer reg address for heuristic memory peripherals --- dts2repl/dts2repl.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dts2repl/dts2repl.py b/dts2repl/dts2repl.py index b27ca55..b81fb6f 100755 --- a/dts2repl/dts2repl.py +++ b/dts2repl/dts2repl.py @@ -497,10 +497,11 @@ def generate(args): _, size = next(get_reg(node)) address = f'<{address}, +{size:#x}>' - # check the registration point of guessed memory peripherals - if is_heuristic_memory: - address, _ = next(get_reg(node)) - address = hex(address) + # check the registration point of guessed memory peripherals + if is_heuristic_memory: + node_reg = next(get_reg(node), None) + if node_reg: + address = hex(node_reg[0]) indent = []