]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dtoc: Correct the re_compat regular expression
authorSimon Glass <sjg@chromium.org>
Sun, 4 Jul 2021 18:19:46 +0000 (12:19 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 21 Jul 2021 16:27:34 +0000 (10:27 -0600)
This expects a . before the field name (.e.g '.compatible = ...) but
presently accepts anything at all. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
tools/dtoc/src_scan.py

index 6c37a71e978c8f16cf2f3c00d0c664feac5ad82d..6e8e1ba51a092f32fdc536509907ca4b1dffaa3a 100644 (file)
@@ -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'