From 5dd715b9c11ad23d5c4a47da1ed4251824aba649 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Fri, 9 Aug 2019 09:49:22 -0500 Subject: [PATCH] scripts/dts/edtlib.py: error check # and -map properties Move when we early out for properties that start with # like "#address-cells" or end with -map like "interrupt-map" to after we do some error checking. This allows us to check those properties at least exist if they are required. Signed-off-by: Kumar Gala --- scripts/dts/edtlib.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/dts/edtlib.py b/scripts/dts/edtlib.py index b6227ecca83..a0d55a01a21 100644 --- a/scripts/dts/edtlib.py +++ b/scripts/dts/edtlib.py @@ -526,11 +526,6 @@ class Device: def _init_prop(self, name, options): # _init_props() helper for initializing a single property - # Skip properties that start with '#', like '#size-cells', and mapping - # properties like 'gpio-map'/'interrupt-map' - if name[0] == "#" or name.endswith("-map"): - return - prop_type = options.get("type") if not prop_type: _err("'{}' in {} lacks 'type'".format(name, self.binding_path)) @@ -548,6 +543,11 @@ class Device: # 'category: optional' property that wasn't there return + # Skip properties that start with '#', like '#size-cells', and mapping + # properties like 'gpio-map'/'interrupt-map' + if name[0] == "#" or name.endswith("-map"): + return + prop = Property() prop.dev = self prop.name = name