Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: davinci: fix SPI_NO_CS functionality

The driver should not touch CS lines if SPI_NO_CS flag is set.
This patch fixes it as this functionality was broken accidentally
by
commit a88e34ea213e1b ("spi: davinci: add support to configure gpio cs through dt").

Fixes: a88e34ea213e1b ("spi: davinci: add support to configure gpio cs through dt")
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>

authored by

Grygorii Strashko and committed by
Mark Brown
3f2dad99 7d1311b9

+8 -8
+8 -8
drivers/spi/spi-davinci.c
··· 417 417 flags, dev_name(&spi->dev)); 418 418 internal_cs = false; 419 419 } 420 - } 421 420 422 - if (retval) { 423 - dev_err(&spi->dev, "GPIO %d setup failed (%d)\n", 424 - spi->cs_gpio, retval); 425 - return retval; 426 - } 421 + if (retval) { 422 + dev_err(&spi->dev, "GPIO %d setup failed (%d)\n", 423 + spi->cs_gpio, retval); 424 + return retval; 425 + } 427 426 428 - if (internal_cs) 429 - set_io_bits(dspi->base + SPIPC0, 1 << spi->chip_select); 427 + if (internal_cs) 428 + set_io_bits(dspi->base + SPIPC0, 1 << spi->chip_select); 429 + } 430 430 431 431 if (spi->mode & SPI_READY) 432 432 set_io_bits(dspi->base + SPIPC0, SPIPC0_SPIENA_MASK);