spi: dt-bindings: spi-controller: Fix #address-cells for slave mode
authorGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 6 Mar 2020 08:50:37 +0000 (09:50 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 13 Mar 2020 17:06:33 +0000 (17:06 +0000)
Currently, the DT bindings for an SPI controller specify that
"#address-cells" must be fixed to one.  However, that applies to an SPI
controller in master mode only.  When running in SPI slave mode,
"#address-cells" should not be specified.

Fix this making "#address-cells" mutually-exclusive with "spi-slave".

Fixes: 0a1b929356830257 ("spi: Add YAML schemas for the generic SPI options")
Reported-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200306085038.8111-2-geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
Documentation/devicetree/bindings/spi/spi-controller.yaml

index 1e0ca6ccf64bbd0a2e257d8dbcda2d829fcb742f..0ebaf6677ac4f68df9fb0acd34b3e2860de9e6dc 100644 (file)
@@ -52,6 +52,12 @@ properties:
     description:
       The SPI controller acts as a slave, instead of a master.
 
+oneOf:
+  - required:
+      - "#address-cells"
+  - required:
+      - spi-slave
+
 patternProperties:
   "^slave$":
     type: object