Skip to contentSkip to conversation

dt-bindings: Drop more redundant 'maxItems/minItems' in if/then schemas

PATCH Applied Rob Herring 4 participants 5 messages Jun 6, 2022 – Jun 7, 2022

Subsystems (7)
lore
Share & tools
lore

Rob Herring

author maintainer
#0 lore raw

PATCH 1/1 dt-bindings: Drop more redundant 'maxItems/minItems' in if/then schemas

Another round from new cases in 5.19-rc of removing redundant minItems/maxItems when 'items' list is specified. This time it is in if/then schemas as the meta-schema was failing to check this case.

If a property has an 'items' list, then a 'minItems' or 'maxItems' with the same size as the list is redundant and can be dropped. Note that is DT schema specific behavior and not standard json-schema behavior. The tooling will fixup the final schema adding any unspecified minItems/maxItems.

---
 .../bindings/memory-controllers/nvidia,tegra186-mc.yaml        | 3 ---
 Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.yaml | 1 -
 .../devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml  | 1 -
 3 files changed, 5 deletions(-)
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml +0 -3
index c7cfa6c2cd81..935d63d181d9 100644
@@ -150,7 +150,6 @@ allOf:
           description: 5 memory controller channels and 1 for stream-id registers
 
         reg-names:
-          maxItems: 6
           items:
             - const: sid
             - const: broadcast
@@ -170,7 +169,6 @@ allOf:
           description: 17 memory controller channels and 1 for stream-id registers
 
         reg-names:
-          minItems: 18
           items:
             - const: sid
             - const: broadcast
@@ -202,7 +200,6 @@ allOf:
           description: 17 memory controller channels and 1 for stream-id registers
 
         reg-names:
-          minItems: 18
           items:
             - const: sid
             - const: broadcast
Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.yaml +0 -1
index c79639e9027e..7a2b22dd6d05 100644
@@ -145,7 +145,6 @@ allOf:
           items:
             - description: Xenon IP registers
             - description: Armada 3700 SoC PHY PAD Voltage Control register
-          minItems: 2
 
         marvell,pad-type:
           $ref: /schemas/types.yaml#/definitions/string
Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml +0 -1
index cbcf19f51411..ed6c1ca80dcc 100644
@@ -64,7 +64,6 @@ if:
 then:
   properties:
     clocks:
-      minItems: 2
       items:
         - description: High-frequency oscillator input, divided internally
         - description: Low-frequency oscillator input
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Rob Herring

Another round from new cases in 5.19-rc of removing redundant minItems/maxItems when 'items' list is specified. This time it is in if/then schemas as the meta-schema was failing to check this case.

If a property has an 'items' list, then a 'minItems' or 'maxItems' with the same size as the list is redundant and can be dropped. Note that is DT schema specific behavior and not standard json-schema behavior. The tooling will fixup the final schema adding any unspecified minItems/maxItems.

Best regards,
Krzysztof

Acked-by on v1 1/1
#2 lore raw
In reply to Rob Herring
Quoted 11 lines · Rob Herring

Another round from new cases in 5.19-rc of removing redundant minItems/maxItems when 'items' list is specified. This time it is in if/then schemas as the meta-schema was failing to check this case.

If a property has an 'items' list, then a 'minItems' or 'maxItems' with the same size as the list is redundant and can be dropped. Note that is DT schema specific behavior and not standard json-schema behavior. The tooling will fixup the final schema adding any unspecified minItems/maxItems.

Kind regards
Uffe

Quoted 61 lines
---
 .../bindings/memory-controllers/nvidia,tegra186-mc.yaml        | 3 ---
 Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.yaml | 1 -
 .../devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml  | 1 -
 3 files changed, 5 deletions(-)
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml +0 -3
index c7cfa6c2cd81..935d63d181d9 100644
@@ -150,7 +150,6 @@ allOf:
           description: 5 memory controller channels and 1 for stream-id registers
 
         reg-names:
-          maxItems: 6
           items:
             - const: sid
             - const: broadcast
@@ -170,7 +169,6 @@ allOf:
           description: 17 memory controller channels and 1 for stream-id registers
 
         reg-names:
-          minItems: 18
           items:
             - const: sid
             - const: broadcast
@@ -202,7 +200,6 @@ allOf:
           description: 17 memory controller channels and 1 for stream-id registers
 
         reg-names:
-          minItems: 18
           items:
             - const: sid
             - const: broadcast
Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.yaml +0 -1
index c79639e9027e..7a2b22dd6d05 100644
@@ -145,7 +145,6 @@ allOf:
           items:
             - description: Xenon IP registers
             - description: Armada 3700 SoC PHY PAD Voltage Control register
-          minItems: 2
 
         marvell,pad-type:
           $ref: /schemas/types.yaml#/definitions/string
Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml +0 -2
index cbcf19f51411..ed6c1ca80dcc 100644
@@ -64,7 +64,6 @@ if:
 then:
   properties:
     clocks:
-      minItems: 2
       items:
         - description: High-frequency oscillator input, divided internally
         - description: Low-frequency oscillator input
--

2.34.1

maintainer Acked-by on v1 1/1
#3 lore raw
In reply to Rob Herring
Quoted 9 lines · Rob Herring

Another round from new cases in 5.19-rc of removing redundant minItems/maxItems when 'items' list is specified. This time it is in if/then schemas as the meta-schema was failing to check this case.

If a property has an 'items' list, then a 'minItems' or 'maxItems' with the same size as the list is redundant and can be dropped. Note that is DT schema specific behavior and not standard json-schema behavior. The tooling will fixup the final schema adding any unspecified minItems/maxItems.

Quoted 5 lines
---
  .../bindings/memory-controllers/nvidia,tegra186-mc.yaml        | 3 ---
  Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.yaml | 1 -
  .../devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml  | 1 -
Quoted 54 lines
  3 files changed, 5 deletions(-)
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml +0 -3
index c7cfa6c2cd81..935d63d181d9 100644
@@ -150,7 +150,6 @@ allOf:
            description: 5 memory controller channels and 1 for stream-id registers
 
          reg-names:
-          maxItems: 6
            items:
              - const: sid
              - const: broadcast
@@ -170,7 +169,6 @@ allOf:
            description: 17 memory controller channels and 1 for stream-id registers
 
          reg-names:
-          minItems: 18
            items:
              - const: sid
              - const: broadcast
@@ -202,7 +200,6 @@ allOf:
            description: 17 memory controller channels and 1 for stream-id registers
 
          reg-names:
-          minItems: 18
            items:
              - const: sid
              - const: broadcast
Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.yaml +0 -1
index c79639e9027e..7a2b22dd6d05 100644
@@ -145,7 +145,6 @@ allOf:
            items:
              - description: Xenon IP registers
              - description: Armada 3700 SoC PHY PAD Voltage Control register
-          minItems: 2
 
          marvell,pad-type:
            $ref: /schemas/types.yaml#/definitions/string
Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml +0 -1
index cbcf19f51411..ed6c1ca80dcc 100644
@@ -64,7 +64,6 @@ if:
  then:
    properties:
      clocks:
-      minItems: 2
        items:
          - description: High-frequency oscillator input, divided internally
          - description: Low-frequency oscillator input
author maintainer Applied
#4 lore raw
In reply to Rob Herring
Quoted 9 lines · Rob Herring

Another round from new cases in 5.19-rc of removing redundant minItems/maxItems when 'items' list is specified. This time it is in if/then schemas as the meta-schema was failing to check this case.

If a property has an 'items' list, then a 'minItems' or 'maxItems' with the same size as the list is redundant and can be dropped. Note that is DT schema specific behavior and not standard json-schema behavior. The tooling will fixup the final schema adding any unspecified minItems/maxItems.

Quoted 7 lines
---
 .../bindings/memory-controllers/nvidia,tegra186-mc.yaml        | 3 ---
 Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.yaml | 1 -
 .../devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml  | 1 -
 3 files changed, 5 deletions(-)

Applied, thanks!