diff options
| author | Zhen Lei <[email protected]> | 2020-10-13 16:08:42 +0000 |
|---|---|---|
| committer | Rob Herring <[email protected]> | 2020-10-14 13:40:20 +0000 |
| commit | faaa30dd1f4bb6ec5eeea751ebde8076375b916c (patch) | |
| tree | cd1ff3695e16fd49f840daba99cadd6ef02e4ace | |
| parent | dt: Remove booting-without-of.rst (diff) | |
| download | kernel-faaa30dd1f4bb6ec5eeea751ebde8076375b916c.tar.gz kernel-faaa30dd1f4bb6ec5eeea751ebde8076375b916c.zip | |
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]>
| -rw-r--r-- | Documentation/devicetree/bindings/spi/spi-controller.yaml | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/Documentation/devicetree/bindings/spi/spi-controller.yaml b/Documentation/devicetree/bindings/spi/spi-controller.yaml index 2b154803b181..1b56d5e40f1f 100644 --- a/Documentation/devicetree/bindings/spi/spi-controller.yaml +++ b/Documentation/devicetree/bindings/spi/spi-controller.yaml @@ -20,7 +20,7 @@ properties: pattern: "^spi(@.*|-[0-9a-f])*$" "#address-cells": - const: 1 + enum: [0, 1] "#size-cells": const: 0 @@ -52,11 +52,19 @@ properties: description: The SPI controller acts as a slave, instead of a master. -oneOf: - - required: - - "#address-cells" - - required: - - spi-slave +allOf: + - if: + not: + required: + - spi-slave + then: + properties: + "#address-cells": + const: 1 + else: + properties: + "#address-cells": + const: 0 patternProperties: "^slave$": |
