scripts/dts: Move prop_names() call into extract_property()

Moves it closer to where it's used, and will allow other simplifications
in generate_node_defines().

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
Ulf Magnusson 2019-02-18 21:35:23 +01:00 committed by Kumar Gala
parent 7bb57fe71f
commit e539479d4f
1 changed files with 5 additions and 4 deletions

View File

@ -57,7 +57,7 @@ def extract_string_prop(node_address, key, label):
defs[node_address][label] = '"' + reduced[node_address]['props'][key] + '"'
def extract_property(node_compat, node_address, prop, prop_val, names):
def extract_property(node_compat, node_address, prop, prop_val):
node = reduced[node_address]
yaml_node_compat = get_binding(node_address)
def_label = get_node_label(node_address)
@ -101,6 +101,8 @@ def extract_property(node_compat, node_address, prop, prop_val, names):
def_label = 'DT_' + def_label
names = prop_names(node, prop)
if prop == 'reg':
reg.extract(node_address, names, def_label, 1)
elif prop == 'interrupts' or prop == 'interrupts-extended':
@ -153,13 +155,12 @@ def generate_node_defines(node_path):
if re.fullmatch(k, c):
match = True
extract_property(node_compat, node_path, c, v,
prop_names(node, c))
extract_property(node_compat, node_path, c, v)
# Handle the case that we have a boolean property, but its not
# in the dts
if not match and v['type'] == 'boolean':
extract_property(node_compat, node_path, k, v, None)
extract_property(node_compat, node_path, k, v)
def prop_names(node, prop_name):