diff mbox series

[v12,08/17] dt-bindings: fix sifive clint compatible string

Message ID 20210115140352.146941-9-damien.lemoal@wdc.com
State Changes Requested, archived
Headers show
Series None | expand

Checks

Context Check Description
robh/checkpatch success
robh/dt-meta-schema fail build log

Commit Message

Damien Le Moal Jan. 15, 2021, 2:03 p.m. UTC
Fix the Sifive clint compatible string definition to make the value
"sifive,fu540-c000-clint" optional, allowing a DT to specify only
"sifive,clint0" for its generic implementation without any tweak.
With this change, a Sifive clint node can now be defined as explained
in the compatible string description.

Cc: Anup Patel <anup.patel@wdc.com>
Cc: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 .../devicetree/bindings/timer/sifive,clint.yaml          | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Rob Herring Jan. 15, 2021, 3:39 p.m. UTC | #1
On Fri, 15 Jan 2021 23:03:43 +0900, Damien Le Moal wrote:
> Fix the Sifive clint compatible string definition to make the value
> "sifive,fu540-c000-clint" optional, allowing a DT to specify only
> "sifive,clint0" for its generic implementation without any tweak.
> With this change, a Sifive clint node can now be defined as explained
> in the compatible string description.
> 
> Cc: Anup Patel <anup.patel@wdc.com>
> Cc: Rob Herring <robh@kernel.org>
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> ---
>  .../devicetree/bindings/timer/sifive,clint.yaml          | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/timer/sifive,clint.example.dt.yaml: timer@2000000: compatible: 'oneOf' conditional failed, one must be fixed:
	['sifive,fu540-c000-clint', 'sifive,clint0'] is too long
	Additional items are not allowed ('sifive,clint0' was unexpected)
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/timer/sifive,clint.yaml

See https://patchwork.ozlabs.org/patch/1427053

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.
Rob Herring Jan. 15, 2021, 4:07 p.m. UTC | #2
On Fri, Jan 15, 2021 at 11:03:43PM +0900, Damien Le Moal wrote:
> Fix the Sifive clint compatible string definition to make the value
> "sifive,fu540-c000-clint" optional, allowing a DT to specify only
> "sifive,clint0" for its generic implementation without any tweak.
> With this change, a Sifive clint node can now be defined as explained
> in the compatible string description.

NACK.

How do you know you'll never need some tweak? Adding it to the DT later 
defeats the whole point of not having to do DT updates to implement 
work-arounds and/or enhancements.

> 
> Cc: Anup Patel <anup.patel@wdc.com>
> Cc: Rob Herring <robh@kernel.org>
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> ---
>  .../devicetree/bindings/timer/sifive,clint.yaml          | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/timer/sifive,clint.yaml b/Documentation/devicetree/bindings/timer/sifive,clint.yaml
> index 2a0e9cd9fbcf..c6b1f37a2949 100644
> --- a/Documentation/devicetree/bindings/timer/sifive,clint.yaml
> +++ b/Documentation/devicetree/bindings/timer/sifive,clint.yaml
> @@ -22,12 +22,13 @@ description:
>  
>  properties:
>    compatible:
> -    items:
> -      - const: sifive,fu540-c000-clint
> -      - const: sifive,clint0
> +    oneOf:
> +      - items:
> +          - enum:
> +              - sifive,fu540-c000-clint
> +              - sifive,clint0
>  
>      description:
> -      Should be "sifive,<chip>-clint" and "sifive,clint<version>".
>        Supported compatible strings are -
>        "sifive,fu540-c000-clint" for the SiFive CLINT v0 as integrated
>        onto the SiFive FU540 chip, and "sifive,clint0" for the SiFive
> -- 
> 2.29.2
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/timer/sifive,clint.yaml b/Documentation/devicetree/bindings/timer/sifive,clint.yaml
index 2a0e9cd9fbcf..c6b1f37a2949 100644
--- a/Documentation/devicetree/bindings/timer/sifive,clint.yaml
+++ b/Documentation/devicetree/bindings/timer/sifive,clint.yaml
@@ -22,12 +22,13 @@  description:
 
 properties:
   compatible:
-    items:
-      - const: sifive,fu540-c000-clint
-      - const: sifive,clint0
+    oneOf:
+      - items:
+          - enum:
+              - sifive,fu540-c000-clint
+              - sifive,clint0
 
     description:
-      Should be "sifive,<chip>-clint" and "sifive,clint<version>".
       Supported compatible strings are -
       "sifive,fu540-c000-clint" for the SiFive CLINT v0 as integrated
       onto the SiFive FU540 chip, and "sifive,clint0" for the SiFive