diff mbox series

dt-bindings: i2c: qcom,i2c-cci: add missing clocks constraint in if:then:

Message ID 20240820063124.9242-1-krzysztof.kozlowski@linaro.org
State Accepted
Delegated to: Andi Shyti
Headers show
Series dt-bindings: i2c: qcom,i2c-cci: add missing clocks constraint in if:then: | expand

Commit Message

Krzysztof Kozlowski Aug. 20, 2024, 6:31 a.m. UTC
Top level defines clocks as variable from 3 to 6 items, so each clause
in if:then: should narrow it further with explicit min and maxItems.
Without minItems, the constrain from top-level is being applied, thus
qcom,msm8996-cci allows between 3 and 4 clocks.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Older dtschema behaved differently and missing minItems was implied in
if:then:. However the preferred policy is to be explicit about such
schema - define strict constraints in if:then:.

Cc: Richard Acayan <mailingradian@gmail.com>
---
 Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml | 1 +
 1 file changed, 1 insertion(+)

Comments

Conor Dooley Aug. 20, 2024, 4:40 p.m. UTC | #1
On Tue, Aug 20, 2024 at 08:31:24AM +0200, Krzysztof Kozlowski wrote:
> Top level defines clocks as variable from 3 to 6 items, so each clause
> in if:then: should narrow it further with explicit min and maxItems.
> Without minItems, the constrain from top-level is being applied, thus
> qcom,msm8996-cci allows between 3 and 4 clocks.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Andi Shyti Aug. 21, 2024, 9:32 p.m. UTC | #2
Hi Krzysztof,

On Tue, Aug 20, 2024 at 08:31:24AM GMT, Krzysztof Kozlowski wrote:
> Top level defines clocks as variable from 3 to 6 items, so each clause
> in if:then: should narrow it further with explicit min and maxItems.
> Without minItems, the constrain from top-level is being applied, thus
> qcom,msm8996-cci allows between 3 and 4 clocks.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Merged in i2c/i2c-host.

Thanks,
Andi
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml b/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml
index c33ae7b63b84..7dab3852c7f8 100644
--- a/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml
+++ b/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml
@@ -130,6 +130,7 @@  allOf:
     then:
       properties:
         clocks:
+          minItems: 4
           maxItems: 4
         clock-names:
           items: