From patchwork Tue Dec 20 01:32:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 13077395 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 A6D65C4167B for ; Tue, 20 Dec 2022 01:45:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232586AbiLTBpx (ORCPT ); Mon, 19 Dec 2022 20:45:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233101AbiLTBpQ (ORCPT ); Mon, 19 Dec 2022 20:45:16 -0500 Received: from mail-oa1-f49.google.com (mail-oa1-f49.google.com [209.85.160.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C53F658C; Mon, 19 Dec 2022 17:32:47 -0800 (PST) Received: by mail-oa1-f49.google.com with SMTP id 586e51a60fabf-1443a16b71cso13756240fac.13; Mon, 19 Dec 2022 17:32:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uQvrXc/8s0udwvhStpHx3CBuMZiJPXpwQx23qaaKMxc=; b=UO5yQjeZOpDKt2/JTfTRpOekvQ+gtBAH45m13+VNtfDKPF4P9JZ9JppxOnDbX7kCNI W6dUWYah1PqhuHdVNoui0qTNcymChOFEm2O+NBAA90IKPi6SSASQE1aCUKvShXkartGI RBRf4yKO5FMw60jeCpe9qBuPb8fd/IFfZ4p9TK2O9W8e07R8D4NsyTHTJ6EUmHX4di+4 xRQk7/4XPMJM+/EP/zRjqeNfKQBHbKCkvcKfBQcw3CHVh5PdcHS+SCDciOGZSbJuy3xF nQrV3dc4qkdBEoK34Alv2oFg8PJwLo4L0pAm7nNk4ed/2jAPjmPwcG4N5LuZVPzcbgPs gCfQ== X-Gm-Message-State: ANoB5pmqCQnDojvdYQ+rfGGPic11O8PHT4tTXlSKtEG/Mqb1eHxpbahE RwrDlkShFl+Qw8+zTnPbxXGGenptTQ== X-Google-Smtp-Source: AA0mqf7GatWayAuECI3POSXHbaGq4XLQPhPgp1k4m3TjFC+RUTJQXxpsoTtbfPN/72Z7mzyAowZHBA== X-Received: by 2002:a05:6870:2186:b0:144:687:9a3c with SMTP id l6-20020a056870218600b0014406879a3cmr21466639oae.45.1671499966220; Mon, 19 Dec 2022 17:32:46 -0800 (PST) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id u8-20020a056871008800b0013d6d924995sm5436668oaa.19.2022.12.19.17.32.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 17:32:45 -0800 (PST) Received: (nullmailer pid 2890620 invoked by uid 1000); Tue, 20 Dec 2022 01:32:44 -0000 From: Rob Herring To: Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier Cc: Marek Vasut , Dmitry Baryshkov , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: Optionally enable schema checks for %.dtb targets Date: Mon, 19 Dec 2022 19:32:33 -0600 Message-Id: <20221220013233.2890335-1-robh@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org While not documented, schema checks for single dtb targets mostly work already by setting 'CHECK_DTBS=1'. However, the dependencies are not handled and it only works if 'make dt_bindings_check' was run first and generated processed-schema.json. In addition, changing a binding file doesn't cause the schema to be rebuilt and dtb to be revalidated. Making this work turns out to be simple. Whenever CHECK_DTBS is set, make 'dt_binding_check' a 'dtbs_prepare' dependency. I reimplemented here what Masahiro had originally come up with a while back. Cc: Marek Vasut Cc: Dmitry Baryshkov Signed-off-by: Rob Herring Tested-by: Marek Vasut Acked-by: Masahiro Yamada Reviewed-by: Dmitry Baryshkov Tested-by: Dmitry Baryshkov --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6aa709df6bde..a99d5c4de0fc 100644 --- a/Makefile +++ b/Makefile @@ -1467,7 +1467,10 @@ dtbs_prepare: include/config/kernel.release scripts_dtc ifneq ($(filter dtbs_check, $(MAKECMDGOALS)),) export CHECK_DTBS=y -dtbs: dt_binding_check +endif + +ifneq ($(CHECK_DTBS),) +dtbs_prepare: dt_binding_check endif dtbs_check: dtbs