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-coldfire-qspi.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-coldfire-qspi.c')
-rw-r--r-- | drivers/spi/spi-coldfire-qspi.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c index 7b5cc9e4e94d..9a7db9d1b4ca 100644 --- a/drivers/spi/spi-coldfire-qspi.c +++ b/drivers/spi/spi-coldfire-qspi.c @@ -312,10 +312,7 @@ static int mcfqspi_transfer_one_message(struct spi_master *master, bool cs_high = spi->mode & SPI_CS_HIGH; u16 qmr = MCFQSPI_QMR_MSTR; - if (t->bits_per_word) - qmr |= t->bits_per_word << 10; - else - qmr |= spi->bits_per_word << 10; + qmr |= t->bits_per_word << 10; if (spi->mode & SPI_CPHA) qmr |= MCFQSPI_QMR_CPHA; if (spi->mode & SPI_CPOL) @@ -377,11 +374,6 @@ static int mcfqspi_unprepare_transfer_hw(struct spi_master *master) static int mcfqspi_setup(struct spi_device *spi) { - if ((spi->bits_per_word < 8) || (spi->bits_per_word > 16)) { - dev_dbg(&spi->dev, "%d bits per word is not supported\n", - spi->bits_per_word); - return -EINVAL; - } if (spi->chip_select >= spi->master->num_chipselect) { dev_dbg(&spi->dev, "%d chip select is out of range\n", spi->chip_select); @@ -477,6 +469,7 @@ static int mcfqspi_probe(struct platform_device *pdev) mcfqspi->dev = &pdev->dev; master->mode_bits = SPI_CS_HIGH | SPI_CPOL | SPI_CPHA; + master->bits_per_word_mask = SPI_BPW_RANGE_MASK(8, 16); master->setup = mcfqspi_setup; master->transfer_one_message = mcfqspi_transfer_one_message; master->prepare_transfer_hardware = mcfqspi_prepare_transfer_hw; |