summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2019-11-08 15:07:38 +0100
committerMark Brown <broonie@kernel.org>2019-11-08 17:43:28 +0000
commit087622d09472f96f1f5d6ced36ca75c92e86af21 (patch)
treebfee21226bd7e488cdcdfb7ea4a1ecfe5f1bcd6c /drivers/spi
parent9b10fa363baf3a506b089f3df3a5afd5e2f244db (diff)
downloadlinux-087622d09472f96f1f5d6ced36ca75c92e86af21.tar.bz2
spi: zynq-qspi: Anything else than CS0 is not supported yet
Unlike what the driver is currently advertizing, CS0 only can be used, CS1 is not supported at all. Prevent people to use CS1. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20191108140744.1734-2-miquel.raynal@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-zynq-qspi.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/spi/spi-zynq-qspi.c b/drivers/spi/spi-zynq-qspi.c
index b1c56e9d7c94..9f53ea08adf7 100644
--- a/drivers/spi/spi-zynq-qspi.c
+++ b/drivers/spi/spi-zynq-qspi.c
@@ -680,10 +680,14 @@ static int zynq_qspi_probe(struct platform_device *pdev)
ret = of_property_read_u32(np, "num-cs",
&num_cs);
- if (ret < 0)
+ if (ret < 0) {
ctlr->num_chipselect = ZYNQ_QSPI_DEFAULT_NUM_CS;
- else
+ } else if (num_cs > ZYNQ_QSPI_DEFAULT_NUM_CS) {
+ dev_err(&pdev->dev, "anything but CS0 is not yet supported\n");
+ goto remove_master;
+ } else {
ctlr->num_chipselect = num_cs;
+ }
ctlr->mode_bits = SPI_RX_DUAL | SPI_RX_QUAD |
SPI_TX_DUAL | SPI_TX_QUAD;