Skip to contentSkip to conversation

nvmem: fixed-cell: Simplify nested if/then schema

PATCH Applied Rob Herring 2 participants 2 messages Jan 26, 2024 – Jan 27, 2024

Subsystems (2)
lore
Share & tools
lore

Rob Herring

author maintainer
#0 lore raw

PATCH 1/1 nvmem: fixed-cell: Simplify nested if/then schema

There's no reason to have a nested if/then schema as checking for compatible being present and containing 'mac-base' can all be done in one 'if' schema.

---
 .../bindings/nvmem/layouts/fixed-cell.yaml    | 22 +++++++++----------
 1 file changed, 10 insertions(+), 12 deletions(-)
Documentation/devicetree/bindings/nvmem/layouts/fixed-cell.yaml +10 -12
index ac2381e66027..8b3826243ddd 100644
@@ -36,20 +36,18 @@ properties:
 
 allOf:
   - if:
+      properties:
+        compatible:
+          contains:
+            const: mac-base
       required: [ compatible ]
     then:
-      if:
-        properties:
-          compatible:
-            contains:
-              const: mac-base
-      then:
-        properties:
-          "#nvmem-cell-cells":
-            description: The first argument is a MAC address offset.
-            const: 1
-        required:
-          - "#nvmem-cell-cells"
+      properties:
+        "#nvmem-cell-cells":
+          description: The first argument is a MAC address offset.
+          const: 1
+      required:
+        - "#nvmem-cell-cells"
 
 required:
   - reg
Signature · 1 line
2.43.0
#1 lore raw
Quoted 4 lines · Rob Herring

There's no reason to have a nested if/then schema as checking for compatible being present and containing 'mac-base' can all be done in one 'if' schema.

Applied, thanks!

[1/1] nvmem: fixed-cell: Simplify nested if/then schema

      commit: 290ea1d6f990c92d5ae599554d8acafdd0ddeb2e

Best regards,

Signature · 1 line
Srinivas Kandagatla <[email protected]>