Skip to contentSkip to conversation

dt-bindings: mfd: allwinner: prcm: Simplify conditional schemas

PATCH Applied Rob Herring 2 participants 2 messages Jul 26, 2023 – Jul 28, 2023

Subsystems (3)
lore
Share & tools
lore

Rob Herring

author maintainer
#0 lore raw

PATCH 1/1 dt-bindings: mfd: allwinner: prcm: Simplify conditional schemas

There's no need for 'additionalProperties' in the if/then schema as there's already 'unevaluatedProperties' in the parent schema. With 'additionalProperties' dropped, 'compatible' and 'phandle' don't need to be listed in the conditional schemas as 'compatible' is already in the main section and 'phandle' will be implicitly added.

---
 .../mfd/allwinner,sun6i-a31-prcm.yaml         | 43 ++-----------------
 .../mfd/allwinner,sun8i-a23-prcm.yaml         | 42 ------------------
 2 files changed, 3 insertions(+), 82 deletions(-)
Documentation/devicetree/bindings/mfd/allwinner,sun6i-a31-prcm.yaml +3 -40
index cf94176fe1eb..8789e3639ff7 100644
@@ -34,6 +34,9 @@ patternProperties:
           - allwinner,sun6i-a31-clock-reset
           - fixed-factor-clock
 
+    required:
+      - compatible
+
     allOf:
       - if:
           properties:
@@ -55,25 +58,17 @@ patternProperties:
             "#clock-cells":
               const: 0
 
-            # Already checked in the main schema
-            compatible: true
-
             clocks:
               maxItems: 2
 
             clock-output-names:
               maxItems: 1
 
-            phandle: true
-
           required:
             - "#clock-cells"
-            - compatible
             - clocks
             - clock-output-names
 
-          additionalProperties: false
-
       - if:
           properties:
             compatible:
@@ -85,25 +80,17 @@ patternProperties:
             "#clock-cells":
               const: 0
 
-            # Already checked in the main schema
-            compatible: true
-
             clocks:
               maxItems: 1
 
             clock-output-names:
               maxItems: 1
 
-            phandle: true
-
           required:
             - "#clock-cells"
-            - compatible
             - clocks
             - clock-output-names
 
-          additionalProperties: false
-
       - if:
           properties:
             compatible:
@@ -119,9 +106,6 @@ patternProperties:
                 offset of the bit controlling this particular gate in
                 the register.
 
-            # Already checked in the main schema
-            compatible: true
-
             clocks:
               maxItems: 1
 
@@ -129,16 +113,11 @@ patternProperties:
               minItems: 1
               maxItems: 32
 
-            phandle: true
-
           required:
             - "#clock-cells"
-            - compatible
             - clocks
             - clock-output-names
 
-          additionalProperties: false
-
       - if:
           properties:
             compatible:
@@ -150,9 +129,6 @@ patternProperties:
             "#clock-cells":
               const: 0
 
-            # Already checked in the main schema
-            compatible: true
-
             clocks:
               maxItems: 4
               description: >
@@ -162,16 +138,11 @@ patternProperties:
             clock-output-names:
               maxItems: 1
 
-            phandle: true
-
           required:
             - "#clock-cells"
-            - compatible
             - clocks
             - clock-output-names
 
-          additionalProperties: false
-
       - if:
           properties:
             compatible:
@@ -183,16 +154,8 @@ patternProperties:
             "#reset-cells":
               const: 1
 
-            # Already checked in the main schema
-            compatible: true
-
-            phandle: true
-
           required:
             - "#reset-cells"
-            - compatible
-
-          additionalProperties: false
 
 required:
   - compatible
Documentation/devicetree/bindings/mfd/allwinner,sun8i-a23-prcm.yaml +0 -42

84 lines not on this page · raw message

Signature · 1 line
2.40.1
maintainer Applied
#1 lore raw

Re: (subset) [PATCH] dt-bindings: mfd: allwinner: prcm: Simplify conditional schemas

Quoted 8 lines · Rob Herring

There's no need for 'additionalProperties' in the if/then schema as there's already 'unevaluatedProperties' in the parent schema. With 'additionalProperties' dropped, 'compatible' and 'phandle' don't need to be listed in the conditional schemas as 'compatible' is already in the main section and 'phandle' will be implicitly added.

[...]

Applied, thanks!

[1/1] dt-bindings: mfd: allwinner: prcm: Simplify conditional schemas

      commit: 67b8e8658577b117ea33b83c6c176ecd39caf1ca

--
Lee Jones [李琼斯]