Skip to content

Commit

Permalink
dts/extract: Add ability to mark aliases as deprecated
Browse files Browse the repository at this point in the history
Add a deprecate flag to add_prop_aliases so we can make the aliases it
generates as deprecated if needed.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
  • Loading branch information
galak committed Jun 21, 2019
1 parent de3d808 commit 6a79bf2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/dts/extract/globals.py
Expand Up @@ -257,7 +257,7 @@ def enable_old_alias_names(enable):
global old_alias_names
old_alias_names = enable

def add_compat_alias(node_path, label_postfix, label, prop_aliases):
def add_compat_alias(node_path, label_postfix, label, prop_aliases, deprecate=False):
if 'instance_id' in reduced[node_path]:
instance = reduced[node_path]['instance_id']
for k in instance:
Expand All @@ -267,9 +267,11 @@ def add_compat_alias(node_path, label_postfix, label, prop_aliases):
prop_aliases[b] = label
b = "DT_INST_{}_{}_{}".format(str(i), str_to_label(k), label_postfix)
prop_aliases[b] = label
if deprecate:
deprecated.append(b)

def add_prop_aliases(node_path,
alias_label_function, prop_label, prop_aliases):
alias_label_function, prop_label, prop_aliases, deprecate=False):
node_compat = get_compat(node_path)
new_alias_prefix = 'DT_'

Expand All @@ -280,8 +282,12 @@ def add_prop_aliases(node_path,

if new_alias_label != prop_label:
prop_aliases[new_alias_label] = prop_label
if deprecate:
deprecated.append(new_alias_label)
if new_alias_compat_label != prop_label:
prop_aliases[new_alias_compat_label] = prop_label
if deprecate:
deprecated.append(new_alias_compat_label)
if old_alias_names and old_alias_label != prop_label:
prop_aliases[old_alias_label] = prop_label

Expand Down

0 comments on commit 6a79bf2

Please sign in to comment.