spi: Eliminate 3WIRE spi_transfer check
authorTrent Piepho <tpiepho@gmail.com>
Fri, 27 Dec 2013 05:51:06 +0000 (21:51 -0800)
committerMark Brown <broonie@linaro.org>
Mon, 30 Dec 2013 12:44:18 +0000 (12:44 +0000)
Checking for SPI_3WIRE isn't needed.  spi_setup() already prevents 3WIRE
mode from being combined with DUAL or QUAD mode support.  So there is no
need to differentiate between a single bit device with SPI_3WIRE set and
one with without.  It doesn't change the allowed bit widths.

Signed-off-by: Trent Piepho <tpiepho@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi.c

index 857ee8c407b145d3f2a972b32d6c6e031ba7223d..2cd9fdc9c7f98bc19c62d6ce6f350b3c6210a124 100644 (file)
@@ -1678,9 +1678,6 @@ static int __spi_validate(struct spi_device *spi, struct spi_message *message)
                        if ((xfer->tx_nbits == SPI_NBITS_QUAD) &&
                                !(spi->mode & SPI_TX_QUAD))
                                return -EINVAL;
-                       if ((spi->mode & SPI_3WIRE) &&
-                               (xfer->tx_nbits != SPI_NBITS_SINGLE))
-                               return -EINVAL;
                }
                /* check transfer rx_nbits */
                if (xfer->rx_buf) {
@@ -1694,9 +1691,6 @@ static int __spi_validate(struct spi_device *spi, struct spi_message *message)
                        if ((xfer->rx_nbits == SPI_NBITS_QUAD) &&
                                !(spi->mode & SPI_RX_QUAD))
                                return -EINVAL;
-                       if ((spi->mode & SPI_3WIRE) &&
-                               (xfer->rx_nbits != SPI_NBITS_SINGLE))
-                               return -EINVAL;
                }
        }
 
This page took 0.025718 seconds and 5 git commands to generate.