scripts/dts/extract: Add get_parent_address helper function
We have a few places that we want the path to the parent, so lets add a helper function for that. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
f7067655d6
commit
bf0001242c
2 changed files with 8 additions and 4 deletions
|
@ -174,12 +174,18 @@ def get_node_label(node_compat, node_address):
|
|||
convert_string_to_label(node_address.split('/')[-1])
|
||||
return def_label
|
||||
|
||||
def find_parent_prop(node_address, prop):
|
||||
def get_parent_address(node_address):
|
||||
parent_address = ''
|
||||
|
||||
for comp in node_address.split('/')[1:-1]:
|
||||
parent_address += '/' + comp
|
||||
|
||||
return parent_address
|
||||
|
||||
|
||||
def find_parent_prop(node_address, prop):
|
||||
parent_address = get_parent_address(node_address)
|
||||
|
||||
if prop in reduced[parent_address]['props']:
|
||||
parent_prop = reduced[parent_address]['props'].get(prop)
|
||||
else:
|
||||
|
|
|
@ -323,9 +323,7 @@ def extract_property(node_compat, yaml, node_address, prop, prop_val, names,
|
|||
if 'parent' in yaml[node_compat]:
|
||||
if 'bus' in yaml[node_compat]['parent']:
|
||||
# get parent label
|
||||
parent_address = ''
|
||||
for comp in node_address.split('/')[1:-1]:
|
||||
parent_address += '/' + comp
|
||||
parent_address = get_parent_address(node_address)
|
||||
|
||||
#check parent has matching child bus value
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue