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:
Nathaniel Graff 2018-08-15 14:19:35 -07:00 committed by Anas Nashif
parent c9ca19949e
commit 0b60f3839d

View file

@ -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