Skip to content
Permalink
Browse files

scripts/dts: generate DT_ALIAS_<ALIAS>_<PROP> defines

DT_ALIAS_<ALIAS>_<PROP> defines are a convenient and portable way to get
the device instance name despite different naming conventions used by
the device drivers.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
  • Loading branch information...
mnkp authored and galak committed Jun 6, 2019
1 parent 132f02e commit 9ac4dc66314e360b34cdfd6bbef20ca03c5a89b2
Showing with 5 additions and 2 deletions.
  1. +5 −2 scripts/dts/extract/globals.py
@@ -271,14 +271,17 @@ def add_compat_alias(node_path, label_postfix, label, prop_aliases):
def add_prop_aliases(node_path,
alias_label_function, prop_label, prop_aliases):
node_compat = get_compat(node_path)
new_alias_prefix = 'DT_' + str_to_label(node_compat)
new_alias_prefix = 'DT_'

for alias in aliases[node_path]:
old_alias_label = alias_label_function(alias)
new_alias_label = new_alias_prefix + '_' + old_alias_label
new_alias_label = new_alias_prefix + 'ALIAS_' + old_alias_label
new_alias_compat_label = new_alias_prefix + str_to_label(node_compat) + '_' + old_alias_label

if new_alias_label != prop_label:
prop_aliases[new_alias_label] = prop_label
if new_alias_compat_label != prop_label:
prop_aliases[new_alias_compat_label] = prop_label
if old_alias_names and old_alias_label != prop_label:
prop_aliases[old_alias_label] = prop_label

0 comments on commit 9ac4dc6

Please sign in to comment.
You can’t perform that action at this time.