Skip to content

Commit

Permalink
schemas: Ensure -names properties' entries are unique
Browse files Browse the repository at this point in the history
The common '.*-names' schema doesn't enforce that entries are unique as
there are a few oddballs. For all the normal cases, we need to enforce the
entries are unique by setting the type to "string-array".

Unfortunately, some oddball cases for 'dma-names' slipped in, so that one
can't be enforced.

Signed-off-by: Rob Herring <[email protected]>
  • Loading branch information
robherring committed Mar 7, 2024
1 parent da1dcdd commit 2bd4676
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions dtschema/schemas/iio/iio-consumer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ properties:
to the device. Note: if the IIO provider specifies '0' for
#io-channel-cells, then only the phandle portion of the pair will appear.
io-channel-names:
$ref: /schemas/types.yaml#/definitions/string-array

io-backends:
$ref: /schemas/types.yaml#/definitions/phandle-array
description:
Expand All @@ -42,6 +45,9 @@ properties:
capable of handling the high sample rates. Examples of the provided
services would be channel enablement/disablement.

io-backend-names:
$ref: /schemas/types.yaml#/definitions/string-array

dependencies:
io-channel-names: [io-channels]
io-backend-names: [io-backends]
Expand Down
3 changes: 3 additions & 0 deletions dtschema/schemas/interconnects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ properties:
interconnects:
$ref: types.yaml#/definitions/phandle-array

interconnect-names:
$ref: /schemas/types.yaml#/definitions/string-array

dependencies:
interconnect-names: [interconnects]

Expand Down
3 changes: 2 additions & 1 deletion dtschema/schemas/pinctrl/pinctrl-consumer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ select: true
properties:
pinctrl-0: true

pinctrl-names: true
pinctrl-names:
$ref: /schemas/types.yaml#/definitions/string-array

patternProperties:
"^pinctrl-[0-9]+$":
Expand Down

0 comments on commit 2bd4676

Please sign in to comment.