Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp595122rdb; Sat, 19 Aug 2023 15:11:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFwbUZdY1EZGU21HW/I0ndDYRxPwDsu5WkR3Lx+/Zo2sV/hGT31CvBdHfyKYcsoQowPOQZU X-Received: by 2002:a05:6a21:788a:b0:13a:3649:dc1a with SMTP id bf10-20020a056a21788a00b0013a3649dc1amr4714116pzc.0.1692483078857; Sat, 19 Aug 2023 15:11:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692483078; cv=none; d=google.com; s=arc-20160816; b=qoRHHBSB1wxwzHOg1thai8p4BHV+C9agQYelNKg211nMAx4t4ml/QxYg4x+L+JYSbM Enzx7zy64/foD/sc6RzDCrq7y36wj8cH66wt1tJrJ6f5HDlNkmYeOmg+3Sy+bksAnZub Tro6Cu8EKAwvYwYv3hw2KnKTFOWZ73HJoP9cRx0P09I4AKqnpZDMmeJIrXZbFXj882TK AXZa4idhnX6qyb3/pGP75o/r7tcMzan0BIwLD0X0sqelN1AdWvlpZP+wRyeGBBtw8lKu hLHfl8t4vsFUT+N65ouON9PIvaIq2a+Xhzgua1lmAX7K9AugVfzch8RD6N8pZcVgpEtU db3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DNoIi35FD35YSTu2toGKPVphwl9FzezOto87axHgRNo=; fh=ottfOqNjVjBXUtKQws8LOtWNw6cDSDHe0Yj5UIwkKjA=; b=0ZEmQGymefE9s8q8Nv1+NSkaEqmQnZRH4qhFb+4QDhvTZ8T5TLHlxTTxd4r1GVcXek 0EUO5FvUW6EuTLSC+EUueZ3vCI6LYByUIhaPzYqOKanuB/2e/XMKp3khVVkkwtjwXnYF FswsEz9kmt119CyA9FVMIEkExauzct+fJ2y8JUuZUjWS/QjAC6uRk+prbQdcFl7Q+Emx 1ZS6gbjZeJBQbFKT3usqoEZbnqAveIJg/9Sr4uNp1AHGvIvnt82qqnfN22DfNYNCBQBT bhDNeNZLQZ2mkYZEwCmlUFmK8h2Ltv3lgmTE1uM5w0z/mkCuErh6TGjRgS74uCjvKfIe NWaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=c8dsZ2sn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n7-20020a6543c7000000b00563e7aa7e3asi3867596pgp.873.2023.08.19.15.11.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Aug 2023 15:11:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=c8dsZ2sn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E3ED3FE28D; Sat, 19 Aug 2023 01:49:48 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356119AbjHQXgx (ORCPT + 99 others); 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: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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Ă­colas 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-compatibles index 2b6d228602e8..bd07477dd144 100755 --- a/scripts/dtc/dt-extract-compatibles +++ b/scripts/dtc/dt-extract-compatibles @@ -7,11 +7,15 @@ import re import argparse -def parse_of_declare_macros(data): +def parse_of_declare_macros(data, include_driver_macros=True): """ Find all compatible strings in OF_DECLARE() style macros """ compat_list = [] # CPU_METHOD_OF_DECLARE does not have a compatible string - for m in re.finditer(r'(?