Skip to content

Commit faaa30d

Browse files
Zhen Leirobherring
authored andcommitted
spi: dt-bindings: spi-controller: explicitly require #address-cells=<0> for slave mode
scripts/dtc/checks.c: if (get_property(node, "spi-slave")) spi_addr_cells = 0; if (node_addr_cells(node) != spi_addr_cells) FAIL(c, dti, node, "incorrect #address-cells for SPI bus"); if (node_size_cells(node) != 0) FAIL(c, dti, node, "incorrect #size-cells for SPI bus"); The above code in check_spi_bus_bridge() require that the number of address cells must be 0. So we should explicitly declare "#address-cells = <0>". Signed-off-by: Zhen Lei <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Herring <[email protected]>
1 parent 4418482 commit faaa30d

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

Documentation/devicetree/bindings/spi/spi-controller.yaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ properties:
2020
pattern: "^spi(@.*|-[0-9a-f])*$"
2121

2222
"#address-cells":
23-
const: 1
23+
enum: [0, 1]
2424

2525
"#size-cells":
2626
const: 0
@@ -52,11 +52,19 @@ properties:
5252
description:
5353
The SPI controller acts as a slave, instead of a master.
5454

55-
oneOf:
56-
- required:
57-
- "#address-cells"
58-
- required:
59-
- spi-slave
55+
allOf:
56+
- if:
57+
not:
58+
required:
59+
- spi-slave
60+
then:
61+
properties:
62+
"#address-cells":
63+
const: 1
64+
else:
65+
properties:
66+
"#address-cells":
67+
const: 0
6068

6169
patternProperties:
6270
"^slave$":

0 commit comments

Comments
 (0)