From ef29f7a1344e6302cc64f1f8be0dcb2e84abe85d Mon Sep 17 00:00:00 2001 From: Allan Norgaard Date: Wed, 11 Jan 2023 15:38:41 +0100 Subject: [PATCH] scripts: dts: gen_driver_kconfig_dts: Skip empty yaml files The YAML parsing will currently return a None-type if no input data is empty, and the subsequent check for a substring will cause an exception. Signed-off-by: Allan Norgaard --- scripts/dts/gen_driver_kconfig_dts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dts/gen_driver_kconfig_dts.py b/scripts/dts/gen_driver_kconfig_dts.py index 5ede8684ef138..2d433bbd5ddf1 100755 --- a/scripts/dts/gen_driver_kconfig_dts.py +++ b/scripts/dts/gen_driver_kconfig_dts.py @@ -80,7 +80,7 @@ def main(): print(f"WARNING: '{binding_path}' appears in binding " f"directories but isn't valid YAML: {e}") continue - if 'compatible' not in raw: + if raw is None or 'compatible' not in raw: continue compat_list.append(raw['compatible'])