Commit 1eb9fabd authored by Rob Herring (Arm)'s avatar Rob Herring (Arm) Committed by Miquel Raynal
Browse files

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: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: default avatarRob Herring (Arm) <robh@kernel.org>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent 95af1e64
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -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]+)?$":
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ properties:

patternProperties:
  "@[0-9a-f]+$":
    $ref: partition.yaml#
    $ref: partition.yaml#/$defs/partition-node

required:
  - "#address-cells"
+12 −0
Original line number Diff line number Diff line
@@ -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 {
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ properties:

patternProperties:
  "^partition-.*$":
    $ref: partition.yaml#
    $ref: partition.yaml#/$defs/partition-node

required:
  - partitions-table-offset
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ properties:

patternProperties:
  "^partition-.*$":
    $ref: partition.yaml#
    $ref: partition.yaml#/$defs/partition-node

unevaluatedProperties: false

Loading