Skip to content

Commit 986536b

Browse files
committed
dt-bindings: Fix array schemas encoded as matrices
The YAML DT encoding has leaked into some array properties. Properties which are defined as an array should have a schema that's just an array. That means there should only be a single level of 'minItems', 'maxItems', and/or 'items'. Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> Link: https://lore.kernel.org/r/20220119015627.2443334-1-robh@kernel.org
1 parent 58dfff3 commit 986536b

File tree

5 files changed

+70
-82
lines changed

5 files changed

+70
-82
lines changed

Documentation/devicetree/bindings/media/nxp,imx7-mipi-csi2.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,12 @@ properties:
8181
data-lanes:
8282
description:
8383
Note that 'fsl,imx7-mipi-csi2' only supports up to 2 data lines.
84+
minItems: 1
8485
items:
85-
minItems: 1
86-
maxItems: 4
87-
items:
88-
- const: 1
89-
- const: 2
90-
- const: 3
91-
- const: 4
86+
- const: 1
87+
- const: 2
88+
- const: 3
89+
- const: 4
9290

9391
required:
9492
- data-lanes

Documentation/devicetree/bindings/media/nxp,imx8mq-mipi-csi2.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,12 @@ properties:
8787

8888
properties:
8989
data-lanes:
90+
minItems: 1
9091
items:
91-
minItems: 1
92-
maxItems: 4
93-
items:
94-
- const: 1
95-
- const: 2
96-
- const: 3
97-
- const: 4
92+
- const: 1
93+
- const: 2
94+
- const: 3
95+
- const: 4
9896

9997
required:
10098
- data-lanes

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

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -76,33 +76,31 @@ properties:
7676
M_CAN user manual for details.
7777
$ref: /schemas/types.yaml#/definitions/int32-array
7878
items:
79-
items:
80-
- description: The 'offset' is an address offset of the Message RAM where
81-
the following elements start from. This is usually set to 0x0 if
82-
you're using a private Message RAM.
83-
default: 0
84-
- description: 11-bit Filter 0-128 elements / 0-128 words
85-
minimum: 0
86-
maximum: 128
87-
- description: 29-bit Filter 0-64 elements / 0-128 words
88-
minimum: 0
89-
maximum: 64
90-
- description: Rx FIFO 0 0-64 elements / 0-1152 words
91-
minimum: 0
92-
maximum: 64
93-
- description: Rx FIFO 1 0-64 elements / 0-1152 words
94-
minimum: 0
95-
maximum: 64
96-
- description: Rx Buffers 0-64 elements / 0-1152 words
97-
minimum: 0
98-
maximum: 64
99-
- description: Tx Event FIFO 0-32 elements / 0-64 words
100-
minimum: 0
101-
maximum: 32
102-
- description: Tx Buffers 0-32 elements / 0-576 words
103-
minimum: 0
104-
maximum: 32
105-
maxItems: 1
79+
- description: The 'offset' is an address offset of the Message RAM where
80+
the following elements start from. This is usually set to 0x0 if
81+
you're using a private Message RAM.
82+
default: 0
83+
- description: 11-bit Filter 0-128 elements / 0-128 words
84+
minimum: 0
85+
maximum: 128
86+
- description: 29-bit Filter 0-64 elements / 0-128 words
87+
minimum: 0
88+
maximum: 64
89+
- description: Rx FIFO 0 0-64 elements / 0-1152 words
90+
minimum: 0
91+
maximum: 64
92+
- description: Rx FIFO 1 0-64 elements / 0-1152 words
93+
minimum: 0
94+
maximum: 64
95+
- description: Rx Buffers 0-64 elements / 0-1152 words
96+
minimum: 0
97+
maximum: 64
98+
- description: Tx Event FIFO 0-32 elements / 0-64 words
99+
minimum: 0
100+
maximum: 32
101+
- description: Tx Buffers 0-32 elements / 0-576 words
102+
minimum: 0
103+
maximum: 32
106104

107105
power-domains:
108106
description:

Documentation/devicetree/bindings/net/ethernet-controller.yaml

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ properties:
1717
description:
1818
Specifies the MAC address that was assigned to the network device.
1919
$ref: /schemas/types.yaml#/definitions/uint8-array
20-
items:
21-
- minItems: 6
22-
maxItems: 6
20+
minItems: 6
21+
maxItems: 6
2322

2423
mac-address:
2524
description:
@@ -28,9 +27,8 @@ properties:
2827
to the device by the boot program is different from the
2928
local-mac-address property.
3029
$ref: /schemas/types.yaml#/definitions/uint8-array
31-
items:
32-
- minItems: 6
33-
maxItems: 6
30+
minItems: 6
31+
maxItems: 6
3432

3533
max-frame-size:
3634
$ref: /schemas/types.yaml#/definitions/uint32
@@ -164,33 +162,30 @@ properties:
164162
type: array
165163
then:
166164
deprecated: true
167-
minItems: 1
168-
maxItems: 1
169165
items:
170-
items:
171-
- minimum: 0
172-
maximum: 31
173-
description:
174-
Emulated PHY ID, choose any but unique to the all
175-
specified fixed-links
176-
177-
- enum: [0, 1]
178-
description:
179-
Duplex configuration. 0 for half duplex or 1 for
180-
full duplex
181-
182-
- enum: [10, 100, 1000, 2500, 10000]
183-
description:
184-
Link speed in Mbits/sec.
185-
186-
- enum: [0, 1]
187-
description:
188-
Pause configuration. 0 for no pause, 1 for pause
189-
190-
- enum: [0, 1]
191-
description:
192-
Asymmetric pause configuration. 0 for no asymmetric
193-
pause, 1 for asymmetric pause
166+
- minimum: 0
167+
maximum: 31
168+
description:
169+
Emulated PHY ID, choose any but unique to the all
170+
specified fixed-links
171+
172+
- enum: [0, 1]
173+
description:
174+
Duplex configuration. 0 for half duplex or 1 for
175+
full duplex
176+
177+
- enum: [10, 100, 1000, 2500, 10000]
178+
description:
179+
Link speed in Mbits/sec.
180+
181+
- enum: [0, 1]
182+
description:
183+
Pause configuration. 0 for no pause, 1 for pause
184+
185+
- enum: [0, 1]
186+
description:
187+
Asymmetric pause configuration. 0 for no asymmetric
188+
pause, 1 for asymmetric pause
194189

195190

196191
- if:

Documentation/devicetree/bindings/nvmem/nvmem.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,15 @@ patternProperties:
5050
Offset and size in bytes within the storage device.
5151

5252
bits:
53-
maxItems: 1
53+
$ref: /schemas/types.yaml#/definitions/uint32-array
5454
items:
55-
items:
56-
- minimum: 0
57-
maximum: 7
58-
description:
59-
Offset in bit within the address range specified by reg.
60-
- minimum: 1
61-
description:
62-
Size in bit within the address range specified by reg.
55+
- minimum: 0
56+
maximum: 7
57+
description:
58+
Offset in bit within the address range specified by reg.
59+
- minimum: 1
60+
description:
61+
Size in bit within the address range specified by reg.
6362

6463
required:
6564
- reg

0 commit comments

Comments
 (0)