Commit 27e4a85c authored by Rob Herring's avatar Rob Herring

dt-bindings: Fix incomplete if/then/else schemas

A recent review highlighted that the json-schema meta-schema allows any
combination of if/then/else schema keywords even though if, then or else
by themselves makes little sense. With an added meta-schema to only
allow valid combinations, there's a handful of schemas found which need
fixing in a variety of ways. Incorrect indentation is the most common
issue.

Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
Cc: Olivier Moysan <olivier.moysan@foss.st.com>
Cc: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Georgi Djakov <djakov@kernel.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Vinod Koul <vkoul@kernel.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Dmitry Osipenko <digetx@gmail.com>
Cc: linux-iio@vger.kernel.org
Cc: alsa-devel@alsa-project.org
Cc: linux-mmc@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-phy@lists.infradead.org
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Acked-by: default avatarJakub Kicinski <kuba@kernel.org>
Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: default avatarMark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20220330145741.3044896-1-robh@kernel.org
parent e7ccd8a4
...@@ -98,6 +98,7 @@ allOf: ...@@ -98,6 +98,7 @@ allOf:
- ti,adc121s - ti,adc121s
- ti,ads7866 - ti,ads7866
- ti,ads7868 - ti,ads7868
then:
required: required:
- vcc-supply - vcc-supply
# Devices with a vref # Devices with a vref
......
...@@ -174,7 +174,7 @@ patternProperties: ...@@ -174,7 +174,7 @@ patternProperties:
contains: contains:
const: st,stm32-dfsdm-adc const: st,stm32-dfsdm-adc
- then: then:
properties: properties:
st,adc-channels: st,adc-channels:
minItems: 1 minItems: 1
...@@ -206,7 +206,7 @@ patternProperties: ...@@ -206,7 +206,7 @@ patternProperties:
contains: contains:
const: st,stm32-dfsdm-dmic const: st,stm32-dfsdm-dmic
- then: then:
properties: properties:
st,adc-channels: st,adc-channels:
maxItems: 1 maxItems: 1
...@@ -254,7 +254,7 @@ allOf: ...@@ -254,7 +254,7 @@ allOf:
contains: contains:
const: st,stm32h7-dfsdm const: st,stm32h7-dfsdm
- then: then:
patternProperties: patternProperties:
"^filter@[0-9]+$": "^filter@[0-9]+$":
properties: properties:
...@@ -269,7 +269,7 @@ allOf: ...@@ -269,7 +269,7 @@ allOf:
contains: contains:
const: st,stm32mp1-dfsdm const: st,stm32mp1-dfsdm
- then: then:
patternProperties: patternProperties:
"^filter@[0-9]+$": "^filter@[0-9]+$":
properties: properties:
......
...@@ -59,9 +59,9 @@ allOf: ...@@ -59,9 +59,9 @@ allOf:
contains: contains:
enum: enum:
- adi,ad5371 - adi,ad5371
then: then:
required: required:
- vref2-supply - vref2-supply
examples: examples:
- | - |
......
...@@ -93,48 +93,48 @@ allOf: ...@@ -93,48 +93,48 @@ allOf:
- qcom,sdm660-gnoc - qcom,sdm660-gnoc
- qcom,sdm660-snoc - qcom,sdm660-snoc
then: then:
properties: properties:
clock-names: clock-names:
items: items:
- const: bus - const: bus
- const: bus_a - const: bus_a
clocks: clocks:
items: items:
- description: Bus Clock - description: Bus Clock
- description: Bus A Clock - description: Bus A Clock
# Child node's properties # Child node's properties
patternProperties: patternProperties:
'^interconnect-[a-z0-9]+$': '^interconnect-[a-z0-9]+$':
type: object type: object
description: description:
snoc-mm is a child of snoc, sharing snoc's register address space. snoc-mm is a child of snoc, sharing snoc's register address space.
properties: properties:
compatible: compatible:
enum: enum:
- qcom,msm8939-snoc-mm - qcom,msm8939-snoc-mm
'#interconnect-cells': '#interconnect-cells':
const: 1 const: 1
clock-names: clock-names:
items: items:
- const: bus - const: bus
- const: bus_a - const: bus_a
clocks: clocks:
items: items:
- description: Bus Clock - description: Bus Clock
- description: Bus A Clock - description: Bus A Clock
required: required:
- compatible - compatible
- '#interconnect-cells' - '#interconnect-cells'
- clock-names - clock-names
- clocks - clocks
- if: - if:
properties: properties:
......
...@@ -197,6 +197,8 @@ allOf: ...@@ -197,6 +197,8 @@ allOf:
- nvidia,tegra30-sdhci - nvidia,tegra30-sdhci
- nvidia,tegra114-sdhci - nvidia,tegra114-sdhci
- nvidia,tegra124-sdhci - nvidia,tegra124-sdhci
then:
properties:
clocks: clocks:
items: items:
- description: module clock - description: module clock
......
...@@ -56,6 +56,7 @@ if: ...@@ -56,6 +56,7 @@ if:
compatible: compatible:
contains: contains:
const: ti,davinci_mdio const: ti,davinci_mdio
then:
required: required:
- bus_freq - bus_freq
......
...@@ -275,17 +275,17 @@ allOf: ...@@ -275,17 +275,17 @@ allOf:
- nvidia,hssquelch-level - nvidia,hssquelch-level
- nvidia,hsdiscon-level - nvidia,hsdiscon-level
else: else:
properties: properties:
clocks: clocks:
maxItems: 4 maxItems: 4
clock-names: clock-names:
items: items:
- const: reg - const: reg
- const: pll_u - const: pll_u
- const: timer - const: timer
- const: utmi-pads - const: utmi-pads
- if: - if:
properties: properties:
......
...@@ -14,24 +14,24 @@ if: ...@@ -14,24 +14,24 @@ if:
compatible: compatible:
contains: contains:
const: qcom,usb-hs-phy-apq8064 const: qcom,usb-hs-phy-apq8064
then: then:
properties: properties:
resets: resets:
maxItems: 1 maxItems: 1
reset-names: reset-names:
const: por const: por
else: else:
properties: properties:
resets: resets:
minItems: 2 minItems: 2
maxItems: 2 maxItems: 2
reset-names: reset-names:
items: items:
- const: phy - const: phy
- const: por - const: por
properties: properties:
compatible: compatible:
...@@ -92,6 +92,8 @@ additionalProperties: false ...@@ -92,6 +92,8 @@ additionalProperties: false
examples: examples:
- | - |
otg: usb-controller { otg: usb-controller {
#reset-cells = <1>;
ulpi { ulpi {
phy { phy {
compatible = "qcom,usb-hs-phy-msm8974", "qcom,usb-hs-phy"; compatible = "qcom,usb-hs-phy-msm8974", "qcom,usb-hs-phy";
......
...@@ -18,23 +18,23 @@ description: ...@@ -18,23 +18,23 @@ description:
allOf: allOf:
- $ref: "regulator.yaml#" - $ref: "regulator.yaml#"
- if:
if: properties:
properties: compatible:
compatible: contains:
contains: const: regulator-fixed-clock
const: regulator-fixed-clock then:
required: required:
- clocks - clocks
else: - if:
if: properties:
properties: compatible:
compatible: contains:
contains: const: regulator-fixed-domain
const: regulator-fixed-domain then:
required: required:
- power-domains - power-domains
- required-opps - required-opps
properties: properties:
compatible: compatible:
......
...@@ -136,8 +136,7 @@ allOf: ...@@ -136,8 +136,7 @@ allOf:
compatible: compatible:
contains: contains:
const: st,stm32f4-sai const: st,stm32f4-sai
then:
- then:
properties: properties:
clocks: clocks:
items: items:
...@@ -148,8 +147,7 @@ allOf: ...@@ -148,8 +147,7 @@ allOf:
items: items:
- const: x8k - const: x8k
- const: x11k - const: x11k
else:
- else:
properties: properties:
clocks: clocks:
items: items:
......
...@@ -136,14 +136,14 @@ required: ...@@ -136,14 +136,14 @@ required:
- reg - reg
if: if:
properties: not:
compatible: properties:
contains: compatible:
enum: contains:
- qcom,rpm-msg-ram enum:
- rockchip,rk3288-pmu-sram - qcom,rpm-msg-ram
- rockchip,rk3288-pmu-sram
else: then:
required: required:
- "#address-cells" - "#address-cells"
- "#size-cells" - "#size-cells"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment