diff options
author | Mark Brown <broonie@linaro.org> | 2013-06-26 17:20:57 +0200 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-06-26 17:20:57 +0200 |
commit | 4581949d522f22d0d9ab710b4a7253754349f5d8 (patch) | |
tree | 3edb2a2f8d5edcf3e3eda6fcc3a6f8a7e2b9d5f8 /drivers/spi/spi-davinci.c | |
parent | Merge remote-tracking branch 'spi/topic/bcm2835' into spi-next (diff) | |
parent | spi: sirf: avoid uninitialized-use warning (diff) | |
download | linux-4581949d522f22d0d9ab710b4a7253754349f5d8.tar.xz linux-4581949d522f22d0d9ab710b4a7253754349f5d8.zip |
Merge remote-tracking branch 'spi/topic/bpw' into spi-next
Diffstat (limited to 'drivers/spi/spi-davinci.c')
-rw-r--r-- | drivers/spi/spi-davinci.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c index 50b13c9b1ab6..b141ef221b14 100644 --- a/drivers/spi/spi-davinci.c +++ b/drivers/spi/spi-davinci.c @@ -299,16 +299,15 @@ static int davinci_spi_setup_transfer(struct spi_device *spi, * Assign function pointer to appropriate transfer method * 8bit, 16bit or 32bit transfer */ - if (bits_per_word <= 8 && bits_per_word >= 2) { + if (bits_per_word <= 8) { dspi->get_rx = davinci_spi_rx_buf_u8; dspi->get_tx = davinci_spi_tx_buf_u8; dspi->bytes_per_word[spi->chip_select] = 1; - } else if (bits_per_word <= 16 && bits_per_word >= 2) { + } else { dspi->get_rx = davinci_spi_rx_buf_u16; dspi->get_tx = davinci_spi_tx_buf_u16; dspi->bytes_per_word[spi->chip_select] = 2; - } else - return -EINVAL; + } if (!hz) hz = spi->max_speed_hz; @@ -933,6 +932,7 @@ static int davinci_spi_probe(struct platform_device *pdev) master->dev.of_node = pdev->dev.of_node; master->bus_num = pdev->id; master->num_chipselect = pdata->num_chipselect; + master->bits_per_word_mask = SPI_BPW_RANGE_MASK(2, 16); master->setup = davinci_spi_setup; dspi->bitbang.chipselect = davinci_spi_chipselect; |