edtlib: allow register addr / size to be None
If the #address-cells property for a register is 0 than we set the addr
value of the reg to None. Similar, if #size-cells is 0 than we set the
size value to None for the reg.
Fixup kconfigfunctions.py to handle reg.size and reg.addr being None.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
diff --git a/scripts/kconfig/kconfigfunctions.py b/scripts/kconfig/kconfigfunctions.py
index 506c43b..91b9511 100644
--- a/scripts/kconfig/kconfigfunctions.py
+++ b/scripts/kconfig/kconfigfunctions.py
@@ -173,6 +173,9 @@
if int(index) >= len(node.regs):
return 0
+ if node.regs[int(index)].addr is None:
+ return 0
+
return node.regs[int(index)].addr >> _dt_units_to_scale(unit)
@@ -186,6 +189,9 @@
if int(index) >= len(node.regs):
return 0
+ if node.regs[int(index)].size is None:
+ return 0
+
return node.regs[int(index)].size >> _dt_units_to_scale(unit)