scripts: compliance: check for bindings in subdirectories

Change the bindings file filter to check for "dts/bindings/" as a
substring rather than prefix. This makes the check catch files in
subdirectories as well (for sample tests and samples), and makes the
check usable on external projects where the bindings may not live in the
project root.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
Fabio Baltieri 2022-12-28 17:06:28 +00:00 committed by Carles Cufí
commit e7a4aec3c9

View file

@ -237,7 +237,7 @@ class DevicetreeBindingsCheck(ComplianceTest):
dt_bindings = []
for file_name in get_files(filter="d"):
if file_name.startswith('dts/bindings/') and file_name.endswith('.yaml'):
if 'dts/bindings/' in file_name and file_name.endswith('.yaml'):
dt_bindings.append(file_name)
return dt_bindings