dts: Fix get_compat when parent compat is a list
When a DTS node has no 'compatible' property and its parent node has a list for its compatible property, return only the first element of the parent's compatible list. Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
This commit is contained in:
parent
c9ca19949e
commit
0b60f3839d
|
@ -81,12 +81,12 @@ def get_compat(node_address):
|
|||
if 'props' in reduced[node_address].keys():
|
||||
compat = reduced[node_address]['props'].get('compatible')
|
||||
|
||||
if isinstance(compat, list):
|
||||
compat = compat[0]
|
||||
|
||||
if compat == None:
|
||||
compat = find_parent_prop(node_address, 'compatible')
|
||||
|
||||
if isinstance(compat, list):
|
||||
compat = compat[0]
|
||||
|
||||
except:
|
||||
pass
|
||||
|
||||
|
|
Loading…
Reference in a new issue