mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 13:11:31 +00:00
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>
This commit is contained in:
parent
059535291c
commit
1712f8b2b7
1 changed files with 2 additions and 2 deletions
|
@ -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_]+)')
|
||||
|
|
Loading…
Add table
Reference in a new issue