diff mbox series

[RFC,1/2] ASoC: dt-bindings: renesas, rsnd.yaml: tidyup reg/reg-name

Message ID 87pmamuvlh.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
State New, archived
Headers show
Series ASoC: dt-bindings: renesas, rsnd.yaml: adjust to R-Car Gen4 | expand

Commit Message

Kuninori Morimoto Feb. 7, 2023, 1:12 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Current reg/reg-name is using "maxItems", but the convention is to
use "minItems".
And the core DT schemas already have a constraint that
requires reg-names to have the same number of elements as reg.

This patch switch to use "minItems" on reg, and remove it from
reg-names.

Link: https://lore.kernel.org/r/46974ae7-5f7f-8fc1-4ea8-fe77b58f5bfb@linaro.org
Reported-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 Documentation/devicetree/bindings/sound/renesas,rsnd.yaml | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Rob Herring Feb. 7, 2023, 9:16 p.m. UTC | #1
On Tue, Feb 07, 2023 at 01:12:42AM +0000, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> Current reg/reg-name is using "maxItems", but the convention is to
> use "minItems".

Yes, but that's not really true in if/then schemas. If that's your 
reason, then the changes are wrong.

> And the core DT schemas already have a constraint that
> requires reg-names to have the same number of elements as reg.

Actually, no it doesn't.

> 
> This patch switch to use "minItems" on reg, and remove it from
> reg-names.
> 
> Link: https://lore.kernel.org/r/46974ae7-5f7f-8fc1-4ea8-fe77b58f5bfb@linaro.org
> Reported-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  Documentation/devicetree/bindings/sound/renesas,rsnd.yaml | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
> index d106de00c6b2..223f4859780f 100644
> --- a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
> +++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
> @@ -298,9 +298,8 @@ allOf:
>      then:
>        properties:
>          reg:
> -          maxItems: 3
> +          minItems: 3

This was probably correct before if the base 'reg' entry says more than 
3 entries are allowed and in this case 3 is most you can have.

>          reg-names:
> -          maxItems: 3
>            items:
>              enum:
>                - scu
> @@ -309,9 +308,8 @@ allOf:
>      else:
>        properties:
>          reg:
> -          maxItems: 5
> +          minItems: 5

This might be correct...

>          reg-names:
> -          maxItems: 5
>            items:
>              enum:
>                - scu
> -- 
> 2.25.1
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
index d106de00c6b2..223f4859780f 100644
--- a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
+++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
@@ -298,9 +298,8 @@  allOf:
     then:
       properties:
         reg:
-          maxItems: 3
+          minItems: 3
         reg-names:
-          maxItems: 3
           items:
             enum:
               - scu
@@ -309,9 +308,8 @@  allOf:
     else:
       properties:
         reg:
-          maxItems: 5
+          minItems: 5
         reg-names:
-          maxItems: 5
           items:
             enum:
               - scu