From nobody Mon Feb 9 15:25:38 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E5D4C71131 for ; Thu, 17 Aug 2023 23:37:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356122AbjHQXgx (ORCPT ); Thu, 17 Aug 2023 19:36:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356192AbjHQXgt (ORCPT ); Thu, 17 Aug 2023 19:36:49 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C54D73595; Thu, 17 Aug 2023 16:36:47 -0700 (PDT) Received: from notapiano.myfiosgateway.com (zone.collabora.co.uk [167.235.23.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id 2EDA666071EB; Fri, 18 Aug 2023 00:36:45 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1692315406; bh=2KgVTEnaEFVbuvK2kyzQ8wdw/iggAoQVGyxWLHJ7ACs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c8dsZ2snflxQGWX61ASKPuDSIeNWkmINuXabd0PDRmomM22DXa1pYlvb565Lr4Wo/ yQRQcYAC/my5dZzIuD7fcEWuKUELPNmAtnkkKup3gPCRQ7b6NgWvtRA6sgA9GUMSnu H/mePYez8jJVB5vPpW9Gi7wtSPC5Qpbvb35bdTGjmOs+MfsV0FJrPG59XXOPxLzg+T ryoskDfwG3MJDIgOYnH1gGxAu+2rRg4lJJPwt136TlffuPPFGRAUC2qY947d//eMUa GztmxJjmaOZOncXuDnfP67v8d6/4sdL9J9RgkUu63CE2+BvMle4cc0zDDbwvCKHq8Q ArIPfURrG/OVA== From: =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= To: Rob Herring , Frank Rowand , Shuah Khan Cc: Mark Brown , kernelci@lists.linux.dev, Guenter Roeck , kernel@collabora.com, Bjorn Andersson , =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] dt: dt-extract-compatibles: Add flag for driver matching compatibles Date: Thu, 17 Aug 2023 19:35:26 -0400 Message-ID: <20230817233635.2306377-3-nfraprado@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230817233635.2306377-1-nfraprado@collabora.com> References: <20230817233635.2306377-1-nfraprado@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a new flag, '--driver-match', to the dt-extract-compatibles script that causes it to only print out compatibles that are expected to match a driver. This output can then be used by tests to detect device probe failures. In order to filter the compatibles down to only ones that will match to a driver, the following is considered: - A compatible needs to show up in a driver's of_match_table for it to be matched to a driver - Compatibles that are used in both of_match_table and OF_DECLARE type macros can't be expected to match to a driver and so are ignored. One exception is CLK_OF_DECLARE_DRIVER, since it indicates that a driver will also later probe, so compatibles in this macro are not ignored. Signed-off-by: N=C3=ADcolas F. R. A. Prado --- Changes in v2: - Added this commit scripts/dtc/dt-extract-compatibles | 57 +++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 9 deletions(-) diff --git a/scripts/dtc/dt-extract-compatibles b/scripts/dtc/dt-extract-co= mpatibles index 2b6d228602e8..bd07477dd144 100755 --- a/scripts/dtc/dt-extract-compatibles +++ b/scripts/dtc/dt-extract-compatibles @@ -7,11 +7,15 @@ import re import argparse =20 =20 -def parse_of_declare_macros(data): +def parse_of_declare_macros(data, include_driver_macros=3DTrue): """ Find all compatible strings in OF_DECLARE() style macros """ compat_list =3D [] # CPU_METHOD_OF_DECLARE does not have a compatible string - for m in re.finditer(r'(?