diff mbox

[v2,01/09] spi: fsl-espi: improve check for SPI_QE_CPU_MODE

Message ID 0b5e7849-88d6-2af5-a428-eeb0de0f2af2@gmail.com (mailing list archive)
State Accepted
Commit e9e128a69af2b5fd2a4e01a59cc7e479ce9b8813
Headers show

Commit Message

Heiner Kallweit Oct. 27, 2016, 7:24 p.m. UTC
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>
---
v2:
- print error message and bail out instead of removing the check
---
 drivers/spi/spi-fsl-espi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Mark Brown Oct. 28, 2016, 6:34 p.m. UTC | #1
On Thu, Oct 27, 2016 at 09:24:01PM +0200, Heiner Kallweit wrote:
> 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.

Please don't send new patches in reply to old ones, it makes it harder
to follow what's going on.
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c
index 4e8a99d..f04c246 100644
--- a/drivers/spi/spi-fsl-espi.c
+++ b/drivers/spi/spi-fsl-espi.c
@@ -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 */