public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dt: dt-check-compatible: Find struct of_device_id instances with compiler annotations
@ 2023-08-04 19:01 Rob Herring
  2023-08-05  9:16 ` Conor Dooley
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Herring @ 2023-08-04 19:01 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Conor Dooley, Frank Rowand; +Cc: devicetree, linux-kernel

The regex search for declarations of struct of_device_id was missing
cases that had a compiler annotation such as "__maybe_unused". Improve
the regex to allow for these. Use '\S' instead of specific characters to
shorten the regex. That also finds some more compatibles using '.'
characters.

Unfortunately, these changes add ~400 more compatibles without a
schema.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 scripts/dtc/dt-extract-compatibles | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/dtc/dt-extract-compatibles b/scripts/dtc/dt-extract-compatibles
index a1119762ed08..9df9f1face83 100755
--- a/scripts/dtc/dt-extract-compatibles
+++ b/scripts/dtc/dt-extract-compatibles
@@ -25,8 +25,8 @@ def parse_of_declare_macros(data):
 def parse_of_device_id(data):
 	""" Find all compatible strings in of_device_id structs """
 	compat_list = []
-	for m in re.finditer(r'of_device_id\s+[a-zA-Z0-9_]+\[\]\s*=\s*({.*?);', data):
-		compat_list += re.findall(r'\.compatible\s+=\s+"([a-zA-Z0-9_\-,]+)"', m[1])
+	for m in re.finditer(r'of_device_id(\s+\S+)?\s+\S+\[\](\s+\S+)?\s*=\s*({.*?);', data):
+		compat_list += re.findall(r'\.compatible\s+=\s+"(\S+)"', m[3])
 
 	return compat_list
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-05  9:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-04 19:01 [PATCH] dt: dt-check-compatible: Find struct of_device_id instances with compiler annotations Rob Herring
2023-08-05  9:16 ` Conor Dooley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox