diff mbox series

[thermal:,thermal/next] dt-bindings: thermal: rcar-thermal: Improve schema validation

Message ID 160621059613.11115.1192711283298552396.tip-bot2@tip-bot2 (mailing list archive)
State Not Applicable, archived
Headers show
Series [thermal:,thermal/next] dt-bindings: thermal: rcar-thermal: Improve schema validation | expand

Commit Message

thermal-bot for Stanislaw Gruszka Nov. 24, 2020, 9:36 a.m. UTC
The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     7cfa9770f485c03c877db4a66bbfda96df367b98
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//7cfa9770f485c03c877db4a66bbfda96df367b98
Author:        Geert Uytterhoeven <geert+renesas@glider.be>
AuthorDate:    Wed, 28 Oct 2020 16:35:41 +01:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Thu, 12 Nov 2020 12:32:30 +01:00

dt-bindings: thermal: rcar-thermal: Improve schema validation

- Factor out common required properties,
  - "interrupts", "clocks", and "power-domains" are required on R-Mobile
    APE6, too,
  - Invert logic to simplify descriptions.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20201028153541.1736279-1-geert+renesas@glider.be
---
 Documentation/devicetree/bindings/thermal/rcar-thermal.yaml | 48 ++++---
 1 file changed, 29 insertions(+), 19 deletions(-)
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/thermal/rcar-thermal.yaml b/Documentation/devicetree/bindings/thermal/rcar-thermal.yaml
index 7e9557a..927de79 100644
--- a/Documentation/devicetree/bindings/thermal/rcar-thermal.yaml
+++ b/Documentation/devicetree/bindings/thermal/rcar-thermal.yaml
@@ -62,25 +62,35 @@  properties:
   "#thermal-sensor-cells":
     const: 0
 
-if:
-  properties:
-    compatible:
-      contains:
-        enum:
-          - renesas,thermal-r8a73a4 # R-Mobile APE6
-          - renesas,thermal-r8a7779 # R-Car H1
-then:
-  required:
-    - compatible
-    - reg
-else:
-  required:
-    - compatible
-    - reg
-    - interrupts
-    - clocks
-    - power-domains
-    - resets
+required:
+  - compatible
+  - reg
+
+allOf:
+  - if:
+      not:
+        properties:
+          compatible:
+            contains:
+              enum:
+                - renesas,thermal-r8a73a4 # R-Mobile APE6
+                - renesas,thermal-r8a7779 # R-Car H1
+    then:
+      required:
+        - resets
+        - '#thermal-sensor-cells'
+
+  - if:
+      not:
+        properties:
+          compatible:
+            contains:
+              const: renesas,thermal-r8a7779 # R-Car H1
+    then:
+      required:
+        - interrupts
+        - clocks
+        - power-domains
 
 additionalProperties: false