From 01e54a54721aa989e4f0947d97607cc84e6b1721 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Fri, 7 Jun 2019 15:36:57 -0500 Subject: [PATCH] scripts/dts: Change DT___ define Its possible that the number could conflict with the register number. This is shown to happen for a device like soc-nv-flash at address 0. So change naming convention to DT_INST___ and make DT___ as deprecated. Signed-off-by: Kumar Gala --- scripts/dts/extract/globals.py | 4 ++++ scripts/dts/extract_dts_includes.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/scripts/dts/extract/globals.py b/scripts/dts/extract/globals.py index c9879c74a16..548087375eb 100644 --- a/scripts/dts/extract/globals.py +++ b/scripts/dts/extract/globals.py @@ -18,6 +18,7 @@ defs = {} bindings = {} bus_bindings = {} binding_compats = [] +deprecated = [] old_alias_names = False regs_config = { @@ -262,6 +263,9 @@ def add_compat_alias(node_path, label_postfix, label, prop_aliases): for k in instance: i = instance[k] b = 'DT_' + str_to_label(k) + '_' + str(i) + '_' + label_postfix + deprecated.append(b) + prop_aliases[b] = label + b = "DT_INST_{}_{}_{}".format(str(i), str_to_label(k), label_postfix) prop_aliases[b] = label def add_prop_aliases(node_path, diff --git a/scripts/dts/extract_dts_includes.py b/scripts/dts/extract_dts_includes.py index 6e7eee628d1..3b6e5977eb7 100755 --- a/scripts/dts/extract_dts_includes.py +++ b/scripts/dts/extract_dts_includes.py @@ -302,6 +302,8 @@ def write_header(f): # for now we special case LED, SW, and *PWM_LED* if not alias.startswith(('DT_', 'LED', 'SW')) and not 'PWM_LED' in alias: deprecated_warn = True + if alias in deprecated: + deprecated_warn = True f.write(define_str(alias, alias_target, value_tabs, deprecated_warn)) f.write('\n')