[PATCH 12/20] dtoc: Allow use of the of_match_ptr() macro

Simon Glass sjg at chromium.org
Thu Dec 17 21:57:26 CET 2020


Update the regex for the of_match member to allow of_match_ptr() so it
matches both:

	.of_match	= apl_hostbridge_ids,
and
	.of_match	= of_match_ptr(apl_hostbridge_ids),

Without this, dtoc emits warnings and cannot find the drivers.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 tools/dtoc/dtb_platdata.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py
index 0c687cb3db0..2ea620e9628 100644
--- a/tools/dtoc/dtb_platdata.py
+++ b/tools/dtoc/dtb_platdata.py
@@ -393,7 +393,8 @@ class DtbPlatdata(object):
         re_ids = re.compile('struct udevice_id (.*)\[\]\s*=')
 
         # Matches the references to the udevice_id list
-        re_of_match = re.compile('\.of_match\s*=\s*([a-z0-9_]+),')
+        re_of_match = re.compile(
+            '\.of_match\s*=\s*(of_match_ptr\()?([a-z0-9_]+)(\))?,')
 
         # Matches the header/size information for priv
         re_priv = re.compile('^\s*DM_PRIV\((.*)\)$')
@@ -418,7 +419,7 @@ class DtbPlatdata(object):
                 if id_m:
                     uclass_id = id_m.group(1)
                 elif id_of_match:
-                    compat = id_of_match.group(1)
+                    compat = id_of_match.group(2)
                 elif '};' in line:
                     if uclass_id and compat:
                         if compat not in of_match:
-- 
2.29.2.684.gfbc64c5ab5-goog



More information about the U-Boot mailing list