Skip to contentSkip to conversation

dt-bindings: thermal: kirkwood-thermal: Convert to DT Schema

PATCH Superseded Shaunak Datar 3 participants 3 messages Nov 12

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: thermal: kirkwood-thermal: Convert to DT Schema

Convert the Kirkwood thermal binding from the legacy text format to YAML schema to enable validation with dtbs_check.

---
 .../bindings/thermal/kirkwood-thermal.txt     | 15 ---------
 .../bindings/thermal/kirkwood-thermal.yaml    | 32 +++++++++++++++++++
 2 files changed, 32 insertions(+), 15 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/thermal/kirkwood-thermal.txt
 create mode 100644 Documentation/devicetree/bindings/thermal/kirkwood-thermal.yaml
Documentation/devicetree/bindings/thermal/kirkwood-thermal.txt deleted +0 -15
deleted file mode 100644
index 8c0f5eb86da7..000000000000
@@ -1,15 +0,0 @@
-* Kirkwood Thermal
-
-This version is for Kirkwood 88F8262 & 88F6283 SoCs. Other kirkwoods
-don't contain a thermal sensor.
-
-Required properties:
-- compatible : "marvell,kirkwood-thermal"
-- reg : Address range of the thermal registers
-
-Example:
-
-	thermal@10078 {
-		compatible = "marvell,kirkwood-thermal";
-		reg = <0x10078 0x4>;
-	};
Documentation/devicetree/bindings/thermal/kirkwood-thermal.yaml new file +32 -0
new file mode 100644
index 000000000000..1f9b97bdd48f
@@ -0,0 +1,32 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/thermal/kirkwood-thermal.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Kirkwood Thermal
+
+maintainers: Nobuhiro Iwamatsu <[email protected]>
+
+description:
+  Thermal sensor present in the Marvell Kirkwood 88F8262 and 88F6283 SoCs.
+
+properties:
+  compatible:
+    const: marvell,kirkwood-thermal
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    thermal@10078 {
+        compatible = "marvell,kirkwood-thermal";
+        reg = <0x10078 0x4>;
+    };
\ No newline at end of file
Signature · 1 line
2.53.0
#1 lore raw
Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [Medium] dt-bindings: thermal: scalar maintainers string breaks schema validation - [Low] dt-bindings…

Thank you for your contribution! Sashiko AI review found 3 potential issues to consider:
- [Medium] dt-bindings: thermal: scalar maintainers string breaks schema validation
- [Low] dt-bindings: thermal: missing newline at end of kirkwood-thermal.yaml
- [Low] dt-bindings: thermal: kirkwood-thermal.yaml filename omits vendor prefix
--

commit 70c9f13751a18e94c7372bae17a84a1ba365709a
Author: Shaunak Datar <[email protected]>

dt-bindings: thermal: kirkwood-thermal: Convert to DT Schema

This commit converts the Marvell Kirkwood thermal sensor device tree binding from plain text to a YAML schema.

Documentation/devicetree/bindings/thermal/kirkwood-thermal.yaml line 5

Quoted 11 lines
Documentation/devicetree/bindings/thermal/kirkwood-thermal.yaml new file +5 -0
new file mode 100644
index 0000000000000..1f9b97bdd48fa
@@ -0,0 +1,32 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/thermal/kirkwood-thermal.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#

[Severity: Low]
Should this file and its $id URI be named marvell,kirkwood-thermal.yaml to match the compatible string and the vendor,device.yaml convention used by sibling Marvell thermal bindings?

Documentation/devicetree/bindings/thermal/kirkwood-thermal.yaml line 9

Quoted 4 lines
Documentation/devicetree/bindings/thermal/kirkwood-thermal.yaml new file +4 -0
+
+title: Kirkwood Thermal
+
+maintainers: Nobuhiro Iwamatsu <[email protected]>

[Severity: Medium]
Does defining maintainers as a scalar string instead of a YAML list cause make dt_binding_check to fail? core.yaml requires maintainers to be an array, so dt-doc-validate rejects this schema and dtbs_check skips it.

[ ... ]

Documentation/devicetree/bindings/thermal/kirkwood-thermal.yaml line 32

Quoted 7 lines
Documentation/devicetree/bindings/thermal/kirkwood-thermal.yaml new file +6 -0
+examples:
+  - |
+    thermal@10078 {
+        compatible = "marvell,kirkwood-thermal";
+        reg = <0x10078 0x4>;
+    };
\ No newline at end of file

[Severity: Low]
Does the missing newline at the end of the file cause yamllint to fail during make dt_binding_check?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#2 lore raw
In reply to Shaunak Datar
Quoted 11 lines · Shaunak Datar

Convert the Kirkwood thermal binding from the legacy text format to YAML schema to enable validation with dtbs_check.

---
 .../bindings/thermal/kirkwood-thermal.txt     | 15 ---------
 .../bindings/thermal/kirkwood-thermal.yaml    | 32 +++++++++++++++++++
 2 files changed, 32 insertions(+), 15 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/thermal/kirkwood-thermal.txt
 create mode 100644 Documentation/devicetree/bindings/thermal/kirkwood-thermal.yaml

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

yamllint warnings/errors:
./Documentation/devicetree/bindings/thermal/kirkwood-thermal.yaml:32:7: [error] no new line character at the end of file (new-line-at-end-of-file)

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/thermal/kirkwood-thermal.yaml: maintainers: "Nobuhiro Iwamatsu <[email protected]>" is not of type "array"

doc reference errors (make refcheckdocs):

See https://patchwork.kernel.org/project/devicetree/patch/[email protected]

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.