diff mbox series

dt-bindings: imx-pata: Convert to dtschema

Message ID 20240301174729.238869-1-animeshagarwal28@gmail.com
State New
Headers show
Series dt-bindings: imx-pata: Convert to dtschema | expand

Commit Message

Animesh Agarwal March 1, 2024, 5:47 p.m. UTC
Convert the imx-pata bindings to DT schema.

Signed-off-by: Animesh Agarwal <animeshagarwal28@gmail.com>
---
 .../devicetree/bindings/ata/imx-pata.txt      | 16 ---------
 .../devicetree/bindings/ata/imx-pata.yaml     | 34 +++++++++++++++++++
 2 files changed, 34 insertions(+), 16 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/ata/imx-pata.txt
 create mode 100644 Documentation/devicetree/bindings/ata/imx-pata.yaml

Comments

Rob Herring March 1, 2024, 7:30 p.m. UTC | #1
On Fri, 01 Mar 2024 23:17:21 +0530, Animesh Agarwal wrote:
> Convert the imx-pata bindings to DT schema.
> 
> Signed-off-by: Animesh Agarwal <animeshagarwal28@gmail.com>
> ---
>  .../devicetree/bindings/ata/imx-pata.txt      | 16 ---------
>  .../devicetree/bindings/ata/imx-pata.yaml     | 34 +++++++++++++++++++
>  2 files changed, 34 insertions(+), 16 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/ata/imx-pata.txt
>  create mode 100644 Documentation/devicetree/bindings/ata/imx-pata.yaml
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/ata/imx-pata.example.dtb: /example-0/pata@83fe0000: failed to match any schema with compatible: ['fsl,imx51-pata', 'fsl,imx27-pata']
Documentation/devicetree/bindings/ata/imx-pata.example.dtb: /example-0/pata@83fe0000: failed to match any schema with compatible: ['fsl,imx51-pata', 'fsl,imx27-pata']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20240301174729.238869-1-animeshagarwal28@gmail.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

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 after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
Krzysztof Kozlowski March 1, 2024, 7:33 p.m. UTC | #2
On 01/03/2024 18:47, Animesh Agarwal wrote:
> Convert the imx-pata bindings to DT schema.

It does not look like you tested the bindings, at least after quick
look. Please run `make dt_binding_check` (see
Documentation/devicetree/bindings/writing-schema.rst for instructions).
Maybe you need to update your dtschema and yamllint.

> 
> Signed-off-by: Animesh Agarwal <animeshagarwal28@gmail.com>
> ---
>  .../devicetree/bindings/ata/imx-pata.txt      | 16 ---------
>  .../devicetree/bindings/ata/imx-pata.yaml     | 34 +++++++++++++++++++

Filename like compatible, so fsl,imx27-pata.yaml

>  2 files changed, 34 insertions(+), 16 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/ata/imx-pata.txt
>  create mode 100644 Documentation/devicetree/bindings/ata/imx-pata.yaml
> 
> diff --git a/Documentation/devicetree/bindings/ata/imx-pata.txt b/Documentation/devicetree/bindings/ata/imx-pata.txt
> deleted file mode 100644
> index f1172f00188a..000000000000
> --- a/Documentation/devicetree/bindings/ata/imx-pata.txt
> +++ /dev/null
> @@ -1,16 +0,0 @@
> -* Freescale i.MX PATA Controller
> -
> -Required properties:
> -- compatible: "fsl,imx27-pata"
> -- reg: Address range of the PATA Controller
> -- interrupts: The interrupt of the PATA Controller
> -- clocks: the clocks for the PATA Controller
> -
> -Example:
> -
> -	pata: pata@83fe0000 {
> -		compatible = "fsl,imx51-pata", "fsl,imx27-pata";
> -		reg = <0x83fe0000 0x4000>;
> -		interrupts = <70>;
> -		clocks = <&clks 161>;
> -	};
> diff --git a/Documentation/devicetree/bindings/ata/imx-pata.yaml b/Documentation/devicetree/bindings/ata/imx-pata.yaml
> new file mode 100644
> index 000000000000..78a562587fb5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/ata/imx-pata.yaml
> @@ -0,0 +1,34 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/ata/imx-pata.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Freescale i.MX PATA Controller
> +
> +maintainers:
> +  - Animesh Agarwal <animeshagarwal28@gmail.com>
> +
> +properties:
> +  compatible: 
> +    enum:
> +      - fsl,imx27

What are you documenting here?

> +  reg:
> +    maxItems: 1

Blank line

> +  interrupts:
> +    items:
> +      - description: PATA Controller interrupts

Blank line... just open example-schema or any other recent bindings
which were reviewed. Don't create entirely different style, but learn
from recent code.

> +  clocks:
> +    items:
> +      - description: PATA Controller clocks
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    pata: pata@83fe0000 {
> +        compatible = "fsl,imx51-pata", "fsl,imx27-pata";

And now please tell me how does it make sense with respect to your
compatible in this binding?

> +        reg = <0x83fe0000 0x4000>;
> +        interrupts = <70>;
> +        clocks = <&clks 161>;
> +    };

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/ata/imx-pata.txt b/Documentation/devicetree/bindings/ata/imx-pata.txt
deleted file mode 100644
index f1172f00188a..000000000000
--- a/Documentation/devicetree/bindings/ata/imx-pata.txt
+++ /dev/null
@@ -1,16 +0,0 @@ 
-* Freescale i.MX PATA Controller
-
-Required properties:
-- compatible: "fsl,imx27-pata"
-- reg: Address range of the PATA Controller
-- interrupts: The interrupt of the PATA Controller
-- clocks: the clocks for the PATA Controller
-
-Example:
-
-	pata: pata@83fe0000 {
-		compatible = "fsl,imx51-pata", "fsl,imx27-pata";
-		reg = <0x83fe0000 0x4000>;
-		interrupts = <70>;
-		clocks = <&clks 161>;
-	};
diff --git a/Documentation/devicetree/bindings/ata/imx-pata.yaml b/Documentation/devicetree/bindings/ata/imx-pata.yaml
new file mode 100644
index 000000000000..78a562587fb5
--- /dev/null
+++ b/Documentation/devicetree/bindings/ata/imx-pata.yaml
@@ -0,0 +1,34 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/ata/imx-pata.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale i.MX PATA Controller
+
+maintainers:
+  - Animesh Agarwal <animeshagarwal28@gmail.com>
+
+properties:
+  compatible: 
+    enum:
+      - fsl,imx27
+  reg:
+    maxItems: 1
+  interrupts:
+    items:
+      - description: PATA Controller interrupts
+  clocks:
+    items:
+      - description: PATA Controller clocks
+
+additionalProperties: false
+
+examples:
+  - |
+    pata: pata@83fe0000 {
+        compatible = "fsl,imx51-pata", "fsl,imx27-pata";
+        reg = <0x83fe0000 0x4000>;
+        interrupts = <70>;
+        clocks = <&clks 161>;
+    };