scripts/dts/edtlib.py: error check enum

Make sure 'enum' is a list in the binding.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2019-08-09 14:53:42 -05:00 committed by Kumar Gala
parent 62bf267bb2
commit cd72ce122b
1 changed files with 4 additions and 0 deletions

View File

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