Skip to content

Commit 27e4a85

Browse files
committed
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: Rob Herring <robh@kernel.org> Acked-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20220330145741.3044896-1-robh@kernel.org
1 parent e7ccd8a commit 27e4a85

File tree

11 files changed

+107
-103
lines changed

11 files changed

+107
-103
lines changed

Documentation/devicetree/bindings/iio/adc/adi,ad7476.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ allOf:
9898
- ti,adc121s
9999
- ti,ads7866
100100
- ti,ads7868
101+
then:
101102
required:
102103
- vcc-supply
103104
# Devices with a vref

Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ patternProperties:
174174
contains:
175175
const: st,stm32-dfsdm-adc
176176

177-
- then:
177+
then:
178178
properties:
179179
st,adc-channels:
180180
minItems: 1
@@ -206,7 +206,7 @@ patternProperties:
206206
contains:
207207
const: st,stm32-dfsdm-dmic
208208

209-
- then:
209+
then:
210210
properties:
211211
st,adc-channels:
212212
maxItems: 1
@@ -254,7 +254,7 @@ allOf:
254254
contains:
255255
const: st,stm32h7-dfsdm
256256

257-
- then:
257+
then:
258258
patternProperties:
259259
"^filter@[0-9]+$":
260260
properties:
@@ -269,7 +269,7 @@ allOf:
269269
contains:
270270
const: st,stm32mp1-dfsdm
271271

272-
- then:
272+
then:
273273
patternProperties:
274274
"^filter@[0-9]+$":
275275
properties:

Documentation/devicetree/bindings/iio/dac/adi,ad5360.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ allOf:
5959
contains:
6060
enum:
6161
- adi,ad5371
62-
then:
63-
required:
64-
- vref2-supply
62+
then:
63+
required:
64+
- vref2-supply
6565

6666
examples:
6767
- |

Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -93,48 +93,48 @@ allOf:
9393
- qcom,sdm660-gnoc
9494
- qcom,sdm660-snoc
9595

96-
then:
97-
properties:
98-
clock-names:
99-
items:
100-
- const: bus
101-
- const: bus_a
102-
103-
clocks:
104-
items:
105-
- description: Bus Clock
106-
- description: Bus A Clock
107-
108-
# Child node's properties
109-
patternProperties:
110-
'^interconnect-[a-z0-9]+$':
111-
type: object
112-
description:
113-
snoc-mm is a child of snoc, sharing snoc's register address space.
114-
115-
properties:
116-
compatible:
117-
enum:
118-
- qcom,msm8939-snoc-mm
119-
120-
'#interconnect-cells':
121-
const: 1
122-
123-
clock-names:
124-
items:
125-
- const: bus
126-
- const: bus_a
127-
128-
clocks:
129-
items:
130-
- description: Bus Clock
131-
- description: Bus A Clock
132-
133-
required:
134-
- compatible
135-
- '#interconnect-cells'
136-
- clock-names
137-
- clocks
96+
then:
97+
properties:
98+
clock-names:
99+
items:
100+
- const: bus
101+
- const: bus_a
102+
103+
clocks:
104+
items:
105+
- description: Bus Clock
106+
- description: Bus A Clock
107+
108+
# Child node's properties
109+
patternProperties:
110+
'^interconnect-[a-z0-9]+$':
111+
type: object
112+
description:
113+
snoc-mm is a child of snoc, sharing snoc's register address space.
114+
115+
properties:
116+
compatible:
117+
enum:
118+
- qcom,msm8939-snoc-mm
119+
120+
'#interconnect-cells':
121+
const: 1
122+
123+
clock-names:
124+
items:
125+
- const: bus
126+
- const: bus_a
127+
128+
clocks:
129+
items:
130+
- description: Bus Clock
131+
- description: Bus A Clock
132+
133+
required:
134+
- compatible
135+
- '#interconnect-cells'
136+
- clock-names
137+
- clocks
138138

139139
- if:
140140
properties:

Documentation/devicetree/bindings/mmc/nvidia,tegra20-sdhci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ allOf:
197197
- nvidia,tegra30-sdhci
198198
- nvidia,tegra114-sdhci
199199
- nvidia,tegra124-sdhci
200+
then:
201+
properties:
200202
clocks:
201203
items:
202204
- description: module clock

Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ if:
5656
compatible:
5757
contains:
5858
const: ti,davinci_mdio
59+
then:
5960
required:
6061
- bus_freq
6162

Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -275,17 +275,17 @@ allOf:
275275
- nvidia,hssquelch-level
276276
- nvidia,hsdiscon-level
277277

278-
else:
279-
properties:
280-
clocks:
281-
maxItems: 4
278+
else:
279+
properties:
280+
clocks:
281+
maxItems: 4
282282

283-
clock-names:
284-
items:
285-
- const: reg
286-
- const: pll_u
287-
- const: timer
288-
- const: utmi-pads
283+
clock-names:
284+
items:
285+
- const: reg
286+
- const: pll_u
287+
- const: timer
288+
- const: utmi-pads
289289

290290
- if:
291291
properties:

Documentation/devicetree/bindings/phy/qcom,usb-hs-phy.yaml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,24 @@ if:
1414
compatible:
1515
contains:
1616
const: qcom,usb-hs-phy-apq8064
17-
then:
18-
properties:
19-
resets:
20-
maxItems: 1
17+
then:
18+
properties:
19+
resets:
20+
maxItems: 1
2121

22-
reset-names:
23-
const: por
22+
reset-names:
23+
const: por
2424

25-
else:
26-
properties:
27-
resets:
28-
minItems: 2
29-
maxItems: 2
25+
else:
26+
properties:
27+
resets:
28+
minItems: 2
29+
maxItems: 2
3030

31-
reset-names:
32-
items:
33-
- const: phy
34-
- const: por
31+
reset-names:
32+
items:
33+
- const: phy
34+
- const: por
3535

3636
properties:
3737
compatible:
@@ -92,6 +92,8 @@ additionalProperties: false
9292
examples:
9393
- |
9494
otg: usb-controller {
95+
#reset-cells = <1>;
96+
9597
ulpi {
9698
phy {
9799
compatible = "qcom,usb-hs-phy-msm8974", "qcom,usb-hs-phy";

Documentation/devicetree/bindings/regulator/fixed-regulator.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ description:
1818

1919
allOf:
2020
- $ref: "regulator.yaml#"
21-
22-
if:
23-
properties:
24-
compatible:
25-
contains:
26-
const: regulator-fixed-clock
27-
required:
28-
- clocks
29-
else:
30-
if:
31-
properties:
32-
compatible:
33-
contains:
34-
const: regulator-fixed-domain
35-
required:
36-
- power-domains
37-
- required-opps
21+
- if:
22+
properties:
23+
compatible:
24+
contains:
25+
const: regulator-fixed-clock
26+
then:
27+
required:
28+
- clocks
29+
- if:
30+
properties:
31+
compatible:
32+
contains:
33+
const: regulator-fixed-domain
34+
then:
35+
required:
36+
- power-domains
37+
- required-opps
3838

3939
properties:
4040
compatible:

Documentation/devicetree/bindings/sound/st,stm32-sai.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ allOf:
136136
compatible:
137137
contains:
138138
const: st,stm32f4-sai
139-
140-
- then:
139+
then:
141140
properties:
142141
clocks:
143142
items:
@@ -148,8 +147,7 @@ allOf:
148147
items:
149148
- const: x8k
150149
- const: x11k
151-
152-
- else:
150+
else:
153151
properties:
154152
clocks:
155153
items:

0 commit comments

Comments
 (0)