devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* dt_binding_check report false alarm?
@ 2023-05-25  5:02 William Zhang
  2023-05-25 13:23 ` Conor Dooley
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: William Zhang @ 2023-05-25  5:02 UTC (permalink / raw)
  To: devicetree, linux-arm-kernel
  Cc: William Zhang, f.fainelli, Krzysztof Kozlowski, Rob Herring

[-- Attachment #1: Type: text/plain, Size: 2277 bytes --]

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
+    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


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4212 bytes --]

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-06-08 23:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-25  5:02 dt_binding_check report false alarm? William Zhang
2023-05-25 13:23 ` Conor Dooley
2023-05-25 15:23   ` William Zhang
2023-05-25 15:33     ` Conor Dooley
2023-05-25 17:10       ` William Zhang
2023-05-25 18:12         ` Conor Dooley
2023-05-26  5:56           ` William Zhang
2023-05-26  6:25             ` Conor Dooley
2023-05-25 17:29     ` Robin Murphy
2023-05-26  1:43 ` Rob Herring
2023-06-08 14:57 ` Rob Herring
2023-06-08 23:00   ` William Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).