]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dt-bindings: mtd: Ensure partition node properties are documented
authorRob Herring (Arm) <robh@kernel.org>
Wed, 21 Jan 2026 19:56:40 +0000 (13:56 -0600)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 22 Jan 2026 14:08:08 +0000 (15:08 +0100)
Partition nodes without a compatible have no restrictions on additional
properties. Fix this by ensuring 'unevaluatedProperties' is set when
there's no compatible property. If there is a compatible property, then
there should be a specific schema for it which will enforce
'unevaluatedProperties'.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Documentation/devicetree/bindings/mtd/mtd.yaml
Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
Documentation/devicetree/bindings/mtd/partitions/partition.yaml
Documentation/devicetree/bindings/mtd/partitions/tplink,safeloader-partitions.yaml
Documentation/devicetree/bindings/mtd/partitions/u-boot.yaml
Documentation/devicetree/bindings/mtd/ti,gpmc-onenand.yaml

index e56dba83f00a7f4b9f0f071a0a639752864eb2ed..5a2d06c96c0d1abbda5f7973a57e5a226649776c 100644 (file)
@@ -36,12 +36,8 @@ properties:
       - compatible
 
 patternProperties:
-  "@[0-9a-f]+$":
-    $ref: partitions/partition.yaml
-    deprecated: true
-
-  "^partition@[0-9a-f]+":
-    $ref: partitions/partition.yaml
+  "(^partition)?@[0-9a-f]+$":
+    $ref: /schemas/mtd/partitions/partition.yaml#/$defs/partition-node
     deprecated: true
 
   "^otp(-[0-9]+)?$":
index 26bef777353d6555677e109887c5c70d66489aeb..4d79f786fcd540e1c54ca990be0555ef51cc0186 100644 (file)
@@ -33,7 +33,7 @@ properties:
 
 patternProperties:
   "@[0-9a-f]+$":
-    $ref: partition.yaml#
+    $ref: partition.yaml#/$defs/partition-node
 
 required:
   - "#address-cells"
index fe2f7d622e8b3a8b266a16e2f9e3fb9662913722..51fd48af55ecc14c2f5ff436ea59612cd2c2dfaf 100644 (file)
@@ -149,6 +149,18 @@ then:
 # This is a generic file other binding inherit from and extend
 additionalProperties: true
 
+$defs:
+  partition-node:
+    type: object
+    if:
+      not:
+        required: [ compatible ]
+    then:
+      $ref: '#'
+      unevaluatedProperties: false
+    else:
+      $ref: '#'
+
 examples:
   - |
     partitions {
index a24bbaac3a9061c91de40ef2d27e4a6e1211ed47..40e6eaab03ce3b394bef1e608c4e94fb72f5f499 100644 (file)
@@ -38,7 +38,7 @@ properties:
 
 patternProperties:
   "^partition-.*$":
-    $ref: partition.yaml#
+    $ref: partition.yaml#/$defs/partition-node
 
 required:
   - partitions-table-offset
index 327fa872c0017850b32b1233d06e73f2b4699cd2..d51bdcb7e58568354478649d6711b1b2ed1c6cb8 100644 (file)
@@ -29,7 +29,7 @@ properties:
 
 patternProperties:
   "^partition-.*$":
-    $ref: partition.yaml#
+    $ref: partition.yaml#/$defs/partition-node
 
 unevaluatedProperties: false
 
index 7d3ace4f55058a2659c4c2ba4417c8d4a462771f..8db991dee7ebdd61877b6ff0053eb4637d3b8aa1 100644 (file)
@@ -36,7 +36,7 @@ properties:
 
 patternProperties:
   "@[0-9a-f]+$":
-    $ref: /schemas/mtd/partitions/partition.yaml
+    $ref: /schemas/mtd/partitions/partition.yaml#/$defs/partition-node
 
 allOf:
   - $ref: /schemas/memory-controllers/ti,gpmc-child.yaml