From: Simon Glass Date: Sun, 4 Jul 2021 18:19:46 +0000 (-0600) Subject: dtoc: Correct the re_compat regular expression X-Git-Tag: v2021.10~90^2~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=893142aa3bce28155905594bb054b0f434cafdfd;p=platform%2Fkernel%2Fu-boot.git dtoc: Correct the re_compat regular expression This expects a . before the field name (.e.g '.compatible = ...) but presently accepts anything at all. Fix it. Signed-off-by: Simon Glass Reviewed-by: Walter Lozano --- diff --git a/tools/dtoc/src_scan.py b/tools/dtoc/src_scan.py index 6c37a71..6e8e1ba 100644 --- a/tools/dtoc/src_scan.py +++ b/tools/dtoc/src_scan.py @@ -452,8 +452,8 @@ class Scanner: # Collect the compatible string, e.g. 'rockchip,rk3288-grf' compat = None - re_compat = re.compile(r'{\s*.compatible\s*=\s*"(.*)"\s*' - r'(,\s*.data\s*=\s*(\S*))?\s*},') + re_compat = re.compile(r'{\s*\.compatible\s*=\s*"(.*)"\s*' + r'(,\s*\.data\s*=\s*(\S*))?\s*},') # This is a dict of compatible strings that were found: # key: Compatible string, e.g. 'rockchip,rk3288-grf'