From 2bd4676206e35ecd209ece06b478c1f1fa7a38ce Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Wed, 6 Mar 2024 18:28:16 -0600 Subject: [PATCH] schemas: Ensure -names properties' entries are unique 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 --- dtschema/schemas/iio/iio-consumer.yaml | 6 ++++++ dtschema/schemas/interconnects.yaml | 3 +++ dtschema/schemas/pinctrl/pinctrl-consumer.yaml | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dtschema/schemas/iio/iio-consumer.yaml b/dtschema/schemas/iio/iio-consumer.yaml index ad2cbd81..7a285a66 100644 --- a/dtschema/schemas/iio/iio-consumer.yaml +++ b/dtschema/schemas/iio/iio-consumer.yaml @@ -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: @@ -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] diff --git a/dtschema/schemas/interconnects.yaml b/dtschema/schemas/interconnects.yaml index 40ecf3c1..6bf40d4c 100644 --- a/dtschema/schemas/interconnects.yaml +++ b/dtschema/schemas/interconnects.yaml @@ -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] diff --git a/dtschema/schemas/pinctrl/pinctrl-consumer.yaml b/dtschema/schemas/pinctrl/pinctrl-consumer.yaml index c6dde464..648c7547 100644 --- a/dtschema/schemas/pinctrl/pinctrl-consumer.yaml +++ b/dtschema/schemas/pinctrl/pinctrl-consumer.yaml @@ -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]+$":