Skip to contentSkip to conversation

dt-bindings: mtd: qcom,nandc: Define properties at top-level

PATCH Applied Rob Herring (Arm) 3 participants 3 messages Jun 25, 2024 – Jul 1, 2024

Subsystems (4)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore

Rob Herring (Arm)

author maintainer
#0 lore raw

PATCH 1/1 dt-bindings: mtd: qcom,nandc: Define properties at top-level

Convention is DT schemas should define all properties at the top-level and not inside of if/then schemas. That minimizes the if/then schemas and is more future proof.

There were 2 "if" schemas for "qcom,ipq806x-nand" and the "qcom,boot-partitions: true" unnecessary, so the conditional schemas can be simplified a bit.

---
 .../devicetree/bindings/mtd/qcom,nandc.yaml   | 38 +++++++------------
 1 file changed, 14 insertions(+), 24 deletions(-)
Documentation/devicetree/bindings/mtd/qcom,nandc.yaml +14 -24
index 4ada60fbf81d..35b4206ea918 100644
@@ -31,6 +31,18 @@ properties:
       - const: core
       - const: aon
 
+  qcom,cmd-crci:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Must contain the ADM command type CRCI block instance number specified for
+      the NAND controller on the given platform
+
+  qcom,data-crci:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Must contain the ADM data type CRCI block instance number specified for
+      the NAND controller on the given platform
+
 patternProperties:
   "^nand@[a-f0-9]$":
     type: object
@@ -83,18 +95,6 @@ allOf:
           items:
             - const: rxtx
 
-        qcom,cmd-crci:
-          $ref: /schemas/types.yaml#/definitions/uint32
-          description:
-            Must contain the ADM command type CRCI block instance number
-            specified for the NAND controller on the given platform
-
-        qcom,data-crci:
-          $ref: /schemas/types.yaml#/definitions/uint32
-          description:
-            Must contain the ADM data type CRCI block instance number
-            specified for the NAND controller on the given platform
-
   - if:
       properties:
         compatible:
@@ -119,19 +119,9 @@ allOf:
             - const: rx
             - const: cmd
 
-  - if:
-      properties:
-        compatible:
-          contains:
-            enum:
-              - qcom,ipq806x-nand
+        qcom,cmd-crci: false
+        qcom,data-crci: false
 
-    then:
-      patternProperties:
-        "^nand@[a-f0-9]$":
-          properties:
-            qcom,boot-partitions: true
-    else:
       patternProperties:
         "^nand@[a-f0-9]$":
           properties:
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Rob Herring (Arm)

Convention is DT schemas should define all properties at the top-level and not inside of if/then schemas. That minimizes the if/then schemas and is more future proof.

There were 2 "if" schemas for "qcom,ipq806x-nand" and the "qcom,boot-partitions: true" unnecessary, so the conditional schemas can be simplified a bit.

Best regards,
Krzysztof

maintainer Applied
#2 lore raw
In reply to Rob Herring (Arm)
Quoted 10 lines · Rob Herring (Arm)

Convention is DT schemas should define all properties at the top-level and not inside of if/then schemas. That minimizes the if/then schemas and is more future proof.

There were 2 "if" schemas for "qcom,ipq806x-nand" and the "qcom,boot-partitions: true" unnecessary, so the conditional schemas can be simplified a bit.

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel