diff options
author | Simon Glass <sjg@chromium.org> | 2021-02-03 06:01:08 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-03-22 19:23:27 +1300 |
commit | 1712f8b2b748ec96442e36d733d421a7ebaa1168 (patch) | |
tree | 75dce1974c5676f5e5724fb2ef1d52d22df983e1 /tools/dtoc | |
parent | 059535291c6785bb64594dd0e47c767e8c9e02bf (diff) | |
download | u-boot-1712f8b2b748ec96442e36d733d421a7ebaa1168.tar.gz u-boot-1712f8b2b748ec96442e36d733d421a7ebaa1168.tar.bz2 u-boot-1712f8b2b748ec96442e36d733d421a7ebaa1168.zip |
dtoc: Detect drivers only at the start of start of line
If a driver declaration is included in a comment, dtoc currently gets
confused. Update the parser to only consider declarations that begin at
the start of a line. Since multi-line comments begin with an asterisk,
this avoids the problem.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc')
-rw-r--r-- | tools/dtoc/src_scan.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/dtoc/src_scan.py b/tools/dtoc/src_scan.py index a275032179..bb22b0b64f 100644 --- a/tools/dtoc/src_scan.py +++ b/tools/dtoc/src_scan.py @@ -331,7 +331,7 @@ class Scanner: # Collect the driver name and associated Driver driver = None - re_driver = re.compile(r'UCLASS_DRIVER\((.*)\)') + re_driver = re.compile(r'^UCLASS_DRIVER\((.*)\)') # Collect the uclass ID, e.g. 'UCLASS_SPI' re_id = re.compile(r'\s*\.id\s*=\s*(UCLASS_[A-Z0-9_]+)') @@ -427,7 +427,7 @@ class Scanner: # Collect the driver info driver = None - re_driver = re.compile(r'U_BOOT_DRIVER\((.*)\)') + re_driver = re.compile(r'^U_BOOT_DRIVER\((.*)\)') # Collect the uclass ID, e.g. 'UCLASS_SPI' re_id = re.compile(r'\s*\.id\s*=\s*(UCLASS_[A-Z0-9_]+)') |