Skip to content

Commit caf83e4

Browse files
committed
dt-bindings: Drop redundant 'maxItems/minItems' in if/then schemas
Another round of removing redundant minItems/maxItems when 'items' list is specified. This time it is in if/then schemas as the meta-schema was failing to check this case. If a property has an 'items' list, then a 'minItems' or 'maxItems' with the same size as the list is redundant and can be dropped. Note that is DT schema specific behavior and not standard json-schema behavior. The tooling will fixup the final schema adding any unspecified minItems/maxItems. Signed-off-by: Rob Herring <robh@kernel.org> Acked-By: Vinod Koul <vkoul@kernel.org> Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> Acked-by: Mark Brown <broonie@kernel.org> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> # For MMC Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> #for IIO Link: https://lore.kernel.org/r/20220503162738.3827041-1-robh@kernel.org
1 parent b2b701b commit caf83e4

13 files changed

Lines changed: 5 additions & 68 deletions

File tree

Documentation/devicetree/bindings/clock/imx8m-clock.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ allOf:
5555
then:
5656
properties:
5757
clocks:
58-
minItems: 7
59-
maxItems: 7
6058
items:
6159
- description: 32k osc
6260
- description: 25m osc
@@ -66,8 +64,6 @@ allOf:
6664
- description: ext3 clock input
6765
- description: ext4 clock input
6866
clock-names:
69-
minItems: 7
70-
maxItems: 7
7167
items:
7268
- const: ckil
7369
- const: osc_25m

Documentation/devicetree/bindings/display/bridge/renesas,lvds.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ then:
9595
properties:
9696
clocks:
9797
minItems: 1
98-
maxItems: 4
9998
items:
10099
- description: Functional clock
101100
- description: EXTAL input clock
@@ -104,7 +103,6 @@ then:
104103

105104
clock-names:
106105
minItems: 1
107-
maxItems: 4
108106
items:
109107
- const: fck
110108
# The LVDS encoder can use the EXTAL or DU_DOTCLKINx clocks.
@@ -128,12 +126,10 @@ then:
128126
else:
129127
properties:
130128
clocks:
131-
maxItems: 1
132129
items:
133130
- description: Functional clock
134131

135132
clock-names:
136-
maxItems: 1
137133
items:
138134
- const: fck
139135

Documentation/devicetree/bindings/display/renesas,du.yaml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,13 @@ allOf:
109109
properties:
110110
clocks:
111111
minItems: 1
112-
maxItems: 3
113112
items:
114113
- description: Functional clock
115114
- description: DU_DOTCLKIN0 input clock
116115
- description: DU_DOTCLKIN1 input clock
117116

118117
clock-names:
119118
minItems: 1
120-
maxItems: 3
121119
items:
122120
- const: du.0
123121
- pattern: '^dclkin\.[01]$'
@@ -159,7 +157,6 @@ allOf:
159157
properties:
160158
clocks:
161159
minItems: 2
162-
maxItems: 4
163160
items:
164161
- description: Functional clock for DU0
165162
- description: Functional clock for DU1
@@ -168,7 +165,6 @@ allOf:
168165

169166
clock-names:
170167
minItems: 2
171-
maxItems: 4
172168
items:
173169
- const: du.0
174170
- const: du.1
@@ -216,7 +212,6 @@ allOf:
216212
properties:
217213
clocks:
218214
minItems: 2
219-
maxItems: 4
220215
items:
221216
- description: Functional clock for DU0
222217
- description: Functional clock for DU1
@@ -225,7 +220,6 @@ allOf:
225220

226221
clock-names:
227222
minItems: 2
228-
maxItems: 4
229223
items:
230224
- const: du.0
231225
- const: du.1
@@ -271,7 +265,6 @@ allOf:
271265
properties:
272266
clocks:
273267
minItems: 2
274-
maxItems: 4
275268
items:
276269
- description: Functional clock for DU0
277270
- description: Functional clock for DU1
@@ -280,7 +273,6 @@ allOf:
280273

281274
clock-names:
282275
minItems: 2
283-
maxItems: 4
284276
items:
285277
- const: du.0
286278
- const: du.1
@@ -327,7 +319,6 @@ allOf:
327319
properties:
328320
clocks:
329321
minItems: 2
330-
maxItems: 4
331322
items:
332323
- description: Functional clock for DU0
333324
- description: Functional clock for DU1
@@ -336,7 +327,6 @@ allOf:
336327

337328
clock-names:
338329
minItems: 2
339-
maxItems: 4
340330
items:
341331
- const: du.0
342332
- const: du.1
@@ -386,7 +376,6 @@ allOf:
386376
properties:
387377
clocks:
388378
minItems: 3
389-
maxItems: 6
390379
items:
391380
- description: Functional clock for DU0
392381
- description: Functional clock for DU1
@@ -397,7 +386,6 @@ allOf:
397386

398387
clock-names:
399388
minItems: 3
400-
maxItems: 6
401389
items:
402390
- const: du.0
403391
- const: du.1
@@ -448,7 +436,6 @@ allOf:
448436
properties:
449437
clocks:
450438
minItems: 4
451-
maxItems: 8
452439
items:
453440
- description: Functional clock for DU0
454441
- description: Functional clock for DU1
@@ -461,7 +448,6 @@ allOf:
461448

462449
clock-names:
463450
minItems: 4
464-
maxItems: 8
465451
items:
466452
- const: du.0
467453
- const: du.1
@@ -525,7 +511,6 @@ allOf:
525511
properties:
526512
clocks:
527513
minItems: 3
528-
maxItems: 6
529514
items:
530515
- description: Functional clock for DU0
531516
- description: Functional clock for DU1
@@ -536,7 +521,6 @@ allOf:
536521

537522
clock-names:
538523
minItems: 3
539-
maxItems: 6
540524
items:
541525
- const: du.0
542526
- const: du.1
@@ -596,7 +580,6 @@ allOf:
596580
properties:
597581
clocks:
598582
minItems: 3
599-
maxItems: 6
600583
items:
601584
- description: Functional clock for DU0
602585
- description: Functional clock for DU1
@@ -607,7 +590,6 @@ allOf:
607590

608591
clock-names:
609592
minItems: 3
610-
maxItems: 6
611593
items:
612594
- const: du.0
613595
- const: du.1
@@ -666,14 +648,12 @@ allOf:
666648
properties:
667649
clocks:
668650
minItems: 1
669-
maxItems: 2
670651
items:
671652
- description: Functional clock for DU0
672653
- description: DU_DOTCLKIN0 input clock
673654

674655
clock-names:
675656
minItems: 1
676-
maxItems: 2
677657
items:
678658
- const: du.0
679659
- const: dclkin.0
@@ -723,7 +703,6 @@ allOf:
723703
properties:
724704
clocks:
725705
minItems: 2
726-
maxItems: 4
727706
items:
728707
- description: Functional clock for DU0
729708
- description: Functional clock for DU1
@@ -732,7 +711,6 @@ allOf:
732711

733712
clock-names:
734713
minItems: 2
735-
maxItems: 4
736714
items:
737715
- const: du.0
738716
- const: du.1
@@ -791,7 +769,6 @@ allOf:
791769
- description: Functional clock
792770

793771
clock-names:
794-
maxItems: 1
795772
items:
796773
- const: du.0
797774

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ allOf:
138138
- const: bus
139139
- const: adc
140140
minItems: 1
141-
maxItems: 2
142141

143142
interrupts:
144143
items:
@@ -170,7 +169,6 @@ allOf:
170169
- const: bus
171170
- const: adc
172171
minItems: 1
173-
maxItems: 2
174172

175173
interrupts:
176174
items:

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,22 +202,17 @@ allOf:
202202
clocks:
203203
items:
204204
- description: module clock
205-
minItems: 1
206-
maxItems: 1
207205
else:
208206
properties:
209207
clocks:
210208
items:
211209
- description: module clock
212210
- description: timeout clock
213-
minItems: 2
214-
maxItems: 2
211+
215212
clock-names:
216213
items:
217214
- const: sdhci
218215
- const: tmclk
219-
minItems: 2
220-
maxItems: 2
221216
required:
222217
- clock-names
223218

Documentation/devicetree/bindings/mtd/gpmi-nand.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ allOf:
147147
- description: SoC gpmi io clock
148148
- description: SoC gpmi bch apb clock
149149
clock-names:
150-
minItems: 2
151-
maxItems: 2
152150
items:
153151
- const: gpmi_io
154152
- const: gpmi_bch_apb

Documentation/devicetree/bindings/net/can/bosch,c_can.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ if:
8080
then:
8181
properties:
8282
interrupts:
83-
minItems: 4
84-
maxItems: 4
8583
items:
8684
- description: Error and status IRQ
8785
- description: Message object IRQ
@@ -91,7 +89,6 @@ then:
9189
else:
9290
properties:
9391
interrupts:
94-
maxItems: 1
9592
items:
9693
- description: Error and status IRQ
9794

Documentation/devicetree/bindings/phy/brcm,sata-phy.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,17 @@ if:
102102
then:
103103
properties:
104104
reg:
105-
maxItems: 2
105+
minItems: 2
106+
106107
reg-names:
107-
items:
108-
- const: "phy"
109-
- const: "phy-ctrl"
108+
minItems: 2
110109
else:
111110
properties:
112111
reg:
113112
maxItems: 1
113+
114114
reg-names:
115115
maxItems: 1
116-
items:
117-
- const: "phy"
118116

119117
required:
120118
- compatible

Documentation/devicetree/bindings/rtc/allwinner,sun6i-a31-rtc.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ allOf:
7171
then:
7272
properties:
7373
clock-output-names:
74-
minItems: 1
7574
maxItems: 1
7675

7776
- if:
@@ -102,7 +101,6 @@ allOf:
102101
properties:
103102
clock-output-names:
104103
minItems: 3
105-
maxItems: 3
106104

107105
- if:
108106
properties:
@@ -113,16 +111,12 @@ allOf:
113111
then:
114112
properties:
115113
clocks:
116-
minItems: 3
117-
maxItems: 3
118114
items:
119115
- description: Bus clock for register access
120116
- description: 24 MHz oscillator
121117
- description: 32 kHz clock from the CCU
122118

123119
clock-names:
124-
minItems: 3
125-
maxItems: 3
126120
items:
127121
- const: bus
128122
- const: hosc
@@ -142,7 +136,6 @@ allOf:
142136
properties:
143137
clocks:
144138
minItems: 3
145-
maxItems: 4
146139
items:
147140
- description: Bus clock for register access
148141
- description: 24 MHz oscillator
@@ -151,7 +144,6 @@ allOf:
151144

152145
clock-names:
153146
minItems: 3
154-
maxItems: 4
155147
items:
156148
- const: bus
157149
- const: hosc
@@ -174,14 +166,12 @@ allOf:
174166
then:
175167
properties:
176168
interrupts:
177-
minItems: 1
178169
maxItems: 1
179170

180171
else:
181172
properties:
182173
interrupts:
183174
minItems: 2
184-
maxItems: 2
185175

186176
required:
187177
- "#clock-cells"

0 commit comments

Comments
 (0)