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>
- 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]+)?$":
patternProperties:
"@[0-9a-f]+$":
- $ref: partition.yaml#
+ $ref: partition.yaml#/$defs/partition-node
required:
- "#address-cells"
# 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 {
patternProperties:
"^partition-.*$":
- $ref: partition.yaml#
+ $ref: partition.yaml#/$defs/partition-node
required:
- partitions-table-offset
patternProperties:
"^partition-.*$":
- $ref: partition.yaml#
+ $ref: partition.yaml#/$defs/partition-node
unevaluatedProperties: false
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