From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Thu, 17 Dec 2020 13:57:26 -0700 Subject: [PATCH 12/20] dtoc: Allow use of the of_match_ptr() macro In-Reply-To: <20201217205734.631098-1-sjg@chromium.org> References: <20201217205734.631098-1-sjg@chromium.org> Message-ID: <20201217205734.631098-5-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- 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