From cd72ce122b1eebcf4f4477261410887543046376 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Fri, 9 Aug 2019 14:53:42 -0500 Subject: [PATCH] scripts/dts/edtlib.py: error check enum Make sure 'enum' is a list in the binding. Signed-off-by: Kumar Gala --- scripts/dts/edtlib.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/dts/edtlib.py b/scripts/dts/edtlib.py index 4c35511b223..b30259c5b72 100644 --- a/scripts/dts/edtlib.py +++ b/scripts/dts/edtlib.py @@ -1253,6 +1253,10 @@ def _check_binding(binding, binding_path): _err("missing, malformed, or empty 'description' for '{}' in " "'properties' in {}".format(prop_name, binding_path)) + if "enum" in options and not isinstance(options["enum"], list): + _err("enum in {} for property '{}' is not a list" + .format(binding_path, prop_name)) + def _translate(addr, node): # Recursively translates 'addr' on 'node' to the address space(s) of its