]> git.karo-electronics.de Git - linux-beck.git/commitdiff
spi: fsl-espi: improve check for SPI_QE_CPU_MODE
authorHeiner Kallweit <hkallweit1@gmail.com>
Thu, 27 Oct 2016 19:24:01 +0000 (21:24 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 28 Oct 2016 18:39:09 +0000 (19:39 +0100)
SPI_QE_CPU_MODE doesn't exist for ESPI and is set by of_mpc8xxx_spi_probe
based on DT property "mode". This property is not defined for ESPI,
see Documentation/devicetree/bindings/spi/fsl-spi.txt.
So print an error message and bail out if SPI_QE_CPU_MODE is set.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsl-espi.c

index 4e8a99d0cb63a8216ad8473ed3e26dfda7bc6cdc..f04c2464e8548fa643994a974e5bcb8b729e9b19 100644 (file)
@@ -583,8 +583,9 @@ static int fsl_espi_probe(struct device *dev, struct resource *mem,
                goto err_probe;
 
        if (mpc8xxx_spi->flags & SPI_QE_CPU_MODE) {
-               mpc8xxx_spi->rx_shift = 16;
-               mpc8xxx_spi->tx_shift = 24;
+               dev_err(dev, "SPI_QE_CPU_MODE is not supported on ESPI!\n");
+               ret = -EINVAL;
+               goto err_probe;
        }
 
        /* SPI controller initializations */