scripts/dts: extract_dts_includes: fix alias creation for subnodes
Heuristic for populating an alias string for a subnode of an alias node was wrong as there was no check if alias already existed and string created was not in line with device tree specfication (allowed chars: [0-9],[a-z], '-'). Fix these two points. Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
parent
060b8c1512
commit
a6716aef15
1 changed files with 7 additions and 2 deletions
|
@ -354,7 +354,12 @@ def extract_property(node_compat, yaml, node_address, prop, prop_val, names):
|
|||
# Generate alias definition if parent has any alias
|
||||
if parent_address in aliases:
|
||||
for i in aliases[parent_address]:
|
||||
node_alias = i + '_' + def_label
|
||||
# Build an alias name that respects device tree specs
|
||||
node_name = node_compat + '-' + node_address.split('@')[-1]
|
||||
node_strip = node_name.replace('@','-').replace(',','-')
|
||||
node_alias = i + '-' + node_strip
|
||||
if node_alias not in aliases[node_address]:
|
||||
# Need to generate alias name for this node:
|
||||
aliases[node_address].append(node_alias)
|
||||
|
||||
# Use parent label to generate label
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue