From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 57A1FC7EE23 for ; Thu, 8 Jun 2023 14:58:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ggcQ+sx9rmJftHuvuy1VjHcyXsslrgG5zGFZdJS4Wy4=; b=IAYX9ZPv08q0xj +aObOBrtw9UBEbW9qmVAsdbQEELPvG4z8Zp4FwRbnKwZR8nfzUPUtVsANx5T42u4Shqqa0YAKkx1u ZwLN634Lmt0aw29aEF4Hv4s//W9e2X5FYtuXwQILaAHG8jHUjA/pyv1g8g7pfr2WmAarEpSYa/aSE B/gUhjI9h/l74NfQFh+fROqxRF5FwUdNTwMzShZ0yWiWn4x3HFgRWWIv2LrjOJkdCgdfu9I2kpGDQ atHQOdc2tlzxOZn6xEPHu5TMOooKZrcOJ9hBTMYnNeemYK9fLeIPPFd3WahEh1g3oj85A9XwVm+Wb rUGVpVGA64PYMa152sfg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7H5E-009gQ2-2S; Thu, 08 Jun 2023 14:57:52 +0000 Received: from mail-il1-f180.google.com ([209.85.166.180]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7H5B-009gPB-0N for linux-arm-kernel@lists.infradead.org; Thu, 08 Jun 2023 14:57:50 +0000 Received: by mail-il1-f180.google.com with SMTP id e9e14a558f8ab-33b1e83e1daso2301035ab.0 for ; Thu, 08 Jun 2023 07:57:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686236265; x=1688828265; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hf6SJl34siTdawLC0RjC1CBtOAo6GZOHG51dtQP3QW0=; b=gUmJeqbAC5xu5UKdMrU1Y2N90PSuGKywZvBp4Fc4W34KGdFyO4DXcii5FUf7RlF9CE sFpquCUtCdXwXqwKKqbFF+ouHBN5AGN9DkvS20THCNb6aG24S0IyMt1RHUTzRIPqIMwH pDV2Y9JrFlzyuaqQvSzTs4glL6GNnllEIWDoX2PH7wrDwVEaEhAsP0RvGC3JNKmd+bvT jn+KBulF7jCQMpN9cmTyCsAsLcQGKgNJmMZX2lUpG9HGDMqRSxKiGBmKNGPMykZp2J2K kmQQDFXwxx7nYxnp+7/TmPAqWuC+HB8KoNEt3S2GXGl4TD4wIqn8Gpm1j1oGMDRT8aAq eGew== X-Gm-Message-State: AC+VfDzpR8VZElNaigcBo1n2/wNkLvM7Y/axMK0WZWypU8Foqx8P3fN2 VQjixgVUewRdqJZ7gv4L+w== X-Google-Smtp-Source: ACHHUZ4JJA2/Br3g1G3dJQSc6yKVFh/khk7lkclFOtTk+QCdeXByAbp2Z90Sd/G25X9eyUdBHznxIQ== X-Received: by 2002:a92:d292:0:b0:335:9028:d6d1 with SMTP id p18-20020a92d292000000b003359028d6d1mr7925695ilp.32.1686236264814; Thu, 08 Jun 2023 07:57:44 -0700 (PDT) Received: from robh_at_kernel.org ([64.188.179.250]) by smtp.gmail.com with ESMTPSA id f5-20020a056638118500b0041eb1fb695csm318647jas.105.2023.06.08.07.57.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 07:57:44 -0700 (PDT) Received: (nullmailer pid 2620990 invoked by uid 1000); Thu, 08 Jun 2023 14:57:42 -0000 Date: Thu, 8 Jun 2023 08:57:42 -0600 From: Rob Herring To: William Zhang Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, f.fainelli@gmail.com, Krzysztof Kozlowski Subject: Re: dt_binding_check report false alarm? Message-ID: <20230608145742.GA2609597-robh@kernel.org> References: <20230525050241.3700-1-william.zhang@broadcom.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230525050241.3700-1-william.zhang@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230608_075749_156187_6FFD1FE3 X-CRM114-Status: GOOD ( 25.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, May 24, 2023 at 10:02:41PM -0700, William Zhang wrote: > Hi, > > It seems dt_binding_check reports a false error when run on this > modified yaml. I picked this simple file just to demostrate this issue. > Basically I made the interrupts and interrupt-names as optional > properties. But when there are two interrupts present, then > interrupt-names are required. However in the example, I don't define > interrupts and interrupt-name at all, the dt binding check reports error > that interrupt-names are required: > > make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/crypto/fsl-imx-scc.yaml > LINT Documentation/devicetree/bindings > CHKDT Documentation/devicetree/bindings/processed-schema.json > SCHEMA Documentation/devicetree/bindings/processed-schema.json > DTEX Documentation/devicetree/bindings/crypto/fsl-imx-scc.example.dts > DTC_CHK Documentation/devicetree/bindings/crypto/fsl-imx-scc.example.dtb > Documentation/devicetree/bindings/crypto/fsl-imx-scc.example.dtb: crypto@53fac000: 'interrupt-names' is a required property > From schema: /home/william/projects/linux/Documentation/devicetree/bindings/crypto/fsl-imx-scc.yaml > > This does not make sense to me as name is required only when there are > two interrupts. Can someone familar with this please help to check if I > miss anything in the yaml file or it is indeed a bug in binding check? > > Thanks, > William > > --- > .../devicetree/bindings/crypto/fsl-imx-scc.yaml | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/Documentation/devicetree/bindings/crypto/fsl-imx-scc.yaml b/Documentation/devicetree/bindings/crypto/fsl-imx-scc.yaml > index 563a31605d2b..c37a3a64a78c 100644 > --- a/Documentation/devicetree/bindings/crypto/fsl-imx-scc.yaml > +++ b/Documentation/devicetree/bindings/crypto/fsl-imx-scc.yaml > @@ -32,11 +32,18 @@ properties: > clock-names: > const: ipg > > +allOf: > + - if: > + properties: > + interrupts: > + minItems: 2 This is a quirk of json-schema in that the 'if' will be true if the property is not present. Adding this to the 'if' should fix the problem: required: - interrupts > + then: > + required: > + - interrupt-names > + > required: > - compatible > - reg > - - interrupts > - - interrupt-names > - clocks > - clock-names > > @@ -49,6 +56,4 @@ examples: > reg = <0x53fac000 0x4000>; > clocks = <&clks 111>; > clock-names = "ipg"; > - interrupts = <49>, <50>; > - interrupt-names = "scm", "smn"; > }; > -- > 2.34.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel