diff mbox series

dt-bindings: dma: uniphier: Use unevaluatedProperties

Message ID 1649317447-20996-1-git-send-email-hayashi.kunihiko@socionext.com (mailing list archive)
State Not Applicable
Headers show
Series dt-bindings: dma: uniphier: Use unevaluatedProperties | expand

Commit Message

Kunihiko Hayashi April 7, 2022, 7:44 a.m. UTC
This refers common bindings, so this is preferred for
unevaluatedProperties instead of additionalProperties.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 .../devicetree/bindings/dma/socionext,uniphier-mio-dmac.yaml    | 2 +-
 .../devicetree/bindings/dma/socionext,uniphier-xdmac.yaml       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Rob Herring (Arm) April 7, 2022, 6:59 p.m. UTC | #1
On Thu, Apr 07, 2022 at 04:44:07PM +0900, Kunihiko Hayashi wrote:
> This refers common bindings, so this is preferred for
> unevaluatedProperties instead of additionalProperties.

Yes and no. If you want to define specific common properties are used 
(and not used), then listing them in the specific schema with 
'additionalProperties' is the right way to do that. If all properties in 
the referenced schema are valid, then unevaluatedProperties is correct.

If we wanted using unevaluatedProperties to be a hard rule, we could 
make the meta-schema enforce that.

> 
> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> ---
>  .../devicetree/bindings/dma/socionext,uniphier-mio-dmac.yaml    | 2 +-
>  .../devicetree/bindings/dma/socionext,uniphier-xdmac.yaml       | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/dma/socionext,uniphier-mio-dmac.yaml b/Documentation/devicetree/bindings/dma/socionext,uniphier-mio-dmac.yaml
> index e7bf6dd7da29..b40f247e07be 100644
> --- a/Documentation/devicetree/bindings/dma/socionext,uniphier-mio-dmac.yaml
> +++ b/Documentation/devicetree/bindings/dma/socionext,uniphier-mio-dmac.yaml
> @@ -45,7 +45,7 @@ required:
>    - clocks
>    - '#dma-cells'
>  
> -additionalProperties: false
> +unevaluatedProperties: false
>  
>  examples:
>    - |
> diff --git a/Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml b/Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml
> index 371f18773198..b2bd21cbeb7f 100644
> --- a/Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml
> +++ b/Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml
> @@ -40,7 +40,7 @@ properties:
>      minimum: 1
>      maximum: 16
>  
> -additionalProperties: false
> +unevaluatedProperties: false
>  
>  required:
>    - compatible
> -- 
> 2.25.1
> 
>
Kunihiko Hayashi April 8, 2022, 4:13 p.m. UTC | #2
Hi Rob,

On 2022/04/08 3:59, Rob Herring wrote:
> On Thu, Apr 07, 2022 at 04:44:07PM +0900, Kunihiko Hayashi wrote:
>> This refers common bindings, so this is preferred for
>> unevaluatedProperties instead of additionalProperties.
> 
> Yes and no. If you want to define specific common properties are used
> (and not used), then listing them in the specific schema with
> 'additionalProperties' is the right way to do that. If all properties in
> the referenced schema are valid, then unevaluatedProperties is correct.

I understand that having a reference to a common schema isn't a direct reason
to replace with unevaluatedProperties because it depends on how each property
of the common schema is handled in this schema.

Since there is no property to evaluate with "if" etc., I think that it can
be left as "additionalProperties" in this schema.
I withdraw this patch.

> If we wanted using unevaluatedProperties to be a hard rule, we could
> make the meta-schema enforce that.

At the moment it is difficult to decide it to be a hard rule.

Thank you,

---
Best Regards
Kunihiko Hayashi
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/dma/socionext,uniphier-mio-dmac.yaml b/Documentation/devicetree/bindings/dma/socionext,uniphier-mio-dmac.yaml
index e7bf6dd7da29..b40f247e07be 100644
--- a/Documentation/devicetree/bindings/dma/socionext,uniphier-mio-dmac.yaml
+++ b/Documentation/devicetree/bindings/dma/socionext,uniphier-mio-dmac.yaml
@@ -45,7 +45,7 @@  required:
   - clocks
   - '#dma-cells'
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
   - |
diff --git a/Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml b/Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml
index 371f18773198..b2bd21cbeb7f 100644
--- a/Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml
+++ b/Documentation/devicetree/bindings/dma/socionext,uniphier-xdmac.yaml
@@ -40,7 +40,7 @@  properties:
     minimum: 1
     maximum: 16
 
-additionalProperties: false
+unevaluatedProperties: false
 
 required:
   - compatible