dt-bindings: mtd: Ensure partition node properties are documented

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>
This commit is contained in:
Rob Herring (Arm)
2026-01-21 13:56:40 -06:00
committed by Miquel Raynal
parent 95af1e641b
commit 1eb9fabd52
6 changed files with 18 additions and 10 deletions

View 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]+)?$":

View File

@@ -33,7 +33,7 @@ properties:
patternProperties:
"@[0-9a-f]+$":
$ref: partition.yaml#
$ref: partition.yaml#/$defs/partition-node
required:
- "#address-cells"

View 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 {

View File

@@ -38,7 +38,7 @@ properties:
patternProperties:
"^partition-.*$":
$ref: partition.yaml#
$ref: partition.yaml#/$defs/partition-node
required:
- partitions-table-offset

View File

@@ -29,7 +29,7 @@ properties:
patternProperties:
"^partition-.*$":
$ref: partition.yaml#
$ref: partition.yaml#/$defs/partition-node
unevaluatedProperties: false

View 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