scripts/dts/extract: Fix producing bogus alias if reg has no size

Its possible that a reg property is address only.  If that's the case we
should produce any alias information for the size.  We should check
nr_size_cells to decide to handle the alias case or not.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2019-02-08 16:04:10 -06:00 committed by Kumar Gala
parent e3e87f624f
commit ec63dca3ea

View File

@ -106,13 +106,13 @@ class DTReg(DTDirective):
'_'.join([str_to_label(alias)] + l_addr + l_idx),
l_addr_fqn,
prop_alias)
add_prop_aliases(
node_address,
lambda alias:
'_'.join([str_to_label(alias)] + l_size + l_idx),
l_size_fqn,
prop_alias)
if nr_size_cells:
add_prop_aliases(
node_address,
lambda alias:
'_'.join([str_to_label(alias)] + l_size + l_idx),
l_size_fqn,
prop_alias)
insert_defs(node_address, prop_def, prop_alias)