diff options
author | Stephen Warren <swarren@wwwdotorg.org> | 2013-05-21 20:36:35 -0600 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-05-29 20:48:17 +0100 |
commit | 24778be20f87d5aadb19624fc768b3159fa43efc (patch) | |
tree | 05124574b6d331f34938bbae09d4014fde7dca76 /drivers/spi/spi-topcliff-pch.c | |
parent | 2922a8de996956893bb98e4aa91be9774c958336 (diff) | |
download | linux-24778be20f87d5aadb19624fc768b3159fa43efc.tar.gz linux-24778be20f87d5aadb19624fc768b3159fa43efc.tar.bz2 linux-24778be20f87d5aadb19624fc768b3159fa43efc.zip |
spi: convert drivers to use bits_per_word_mask
Fill in the recently added spi_master.bits_per_word_mask field in as
many drivers as possible. Make related cleanups, such as removing any
redundant error-checking, or empty setup callbacks.
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/spi/spi-topcliff-pch.c')
-rw-r--r-- | drivers/spi/spi-topcliff-pch.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c index 35f60bd252dd..15cb39b0549e 100644 --- a/drivers/spi/spi-topcliff-pch.c +++ b/drivers/spi/spi-topcliff-pch.c @@ -472,11 +472,6 @@ static int pch_spi_setup(struct spi_device *pspi) dev_dbg(&pspi->dev, "%s 8 bits per word\n", __func__); } - if ((pspi->bits_per_word != 8) && (pspi->bits_per_word != 16)) { - dev_err(&pspi->dev, "%s Invalid bits per word\n", __func__); - return -EINVAL; - } - /* Check baud rate setting */ /* if baud rate of chip is greater than max we can support,return error */ @@ -537,17 +532,6 @@ static int pch_spi_transfer(struct spi_device *pspi, struct spi_message *pmsg) /* if baud rate has been specified validate the same */ if (transfer->speed_hz > PCH_MAX_BAUDRATE) transfer->speed_hz = PCH_MAX_BAUDRATE; - - /* if bits per word has been specified validate the same */ - if (transfer->bits_per_word) { - if ((transfer->bits_per_word != 8) - && (transfer->bits_per_word != 16)) { - retval = -EINVAL; - dev_err(&pspi->dev, - "%s Invalid bits per word\n", __func__); - goto err_return_spinlock; - } - } } spin_unlock_irqrestore(&data->lock, flags); @@ -1442,6 +1426,7 @@ static int pch_spi_pd_probe(struct platform_device *plat_dev) master->setup = pch_spi_setup; master->transfer = pch_spi_transfer; master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_LSB_FIRST; + master->bits_per_word_mask = SPI_BPW_MASK(8) | SPI_BPW_MASK(16); data->board_dat = board_dat; data->plat_dev = plat_dev; |