scripts/dts: Change DT_<COMPAT>_<INSTANCE>_<PROP> define
Its possible that the <INSTANCE> 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_<INSTANCE>_<COMPAT>_<PROP> and make DT_<COMPAT>_<INSTANCE>_<PROP> as deprecated. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
a788ce23da
commit
01e54a5472
2 changed files with 6 additions and 0 deletions
|
@ -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,
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue