aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-au1550.c
diff options
context:
space:
mode:
authorStephen Warren <swarren@wwwdotorg.org>2013-05-21 22:36:35 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-05-29 15:48:17 -0400
commit24778be20f87d5aadb19624fc768b3159fa43efc (patch)
tree05124574b6d331f34938bbae09d4014fde7dca76 /drivers/spi/spi-au1550.c
parent2922a8de996956893bb98e4aa91be9774c958336 (diff)
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-au1550.c')
-rw-r--r--drivers/spi/spi-au1550.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/spi/spi-au1550.c b/drivers/spi/spi-au1550.c
index 44dd34b6ad09..d736fa942020 100644
--- a/drivers/spi/spi-au1550.c
+++ b/drivers/spi/spi-au1550.c
@@ -248,11 +248,6 @@ static int au1550_spi_setupxfer(struct spi_device *spi, struct spi_transfer *t)
248 hz = t->speed_hz; 248 hz = t->speed_hz;
249 } 249 }
250 250
251 if (bpw < 4 || bpw > 24) {
252 dev_err(&spi->dev, "setupxfer: invalid bits_per_word=%d\n",
253 bpw);
254 return -EINVAL;
255 }
256 if (hz > spi->max_speed_hz || hz > hw->freq_max || hz < hw->freq_min) { 251 if (hz > spi->max_speed_hz || hz > hw->freq_max || hz < hw->freq_min) {
257 dev_err(&spi->dev, "setupxfer: clock rate=%d out of range\n", 252 dev_err(&spi->dev, "setupxfer: clock rate=%d out of range\n",
258 hz); 253 hz);
@@ -296,12 +291,6 @@ static int au1550_spi_setup(struct spi_device *spi)
296{ 291{
297 struct au1550_spi *hw = spi_master_get_devdata(spi->master); 292 struct au1550_spi *hw = spi_master_get_devdata(spi->master);
298 293
299 if (spi->bits_per_word < 4 || spi->bits_per_word > 24) {
300 dev_err(&spi->dev, "setup: invalid bits_per_word=%d\n",
301 spi->bits_per_word);
302 return -EINVAL;
303 }
304
305 if (spi->max_speed_hz == 0) 294 if (spi->max_speed_hz == 0)
306 spi->max_speed_hz = hw->freq_max; 295 spi->max_speed_hz = hw->freq_max;
307 if (spi->max_speed_hz > hw->freq_max 296 if (spi->max_speed_hz > hw->freq_max
@@ -782,6 +771,7 @@ static int au1550_spi_probe(struct platform_device *pdev)
782 771
783 /* the spi->mode bits understood by this driver: */ 772 /* the spi->mode bits understood by this driver: */
784 master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST; 773 master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST;
774 master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 24);
785 775
786 hw = spi_master_get_devdata(master); 776 hw = spi_master_get_devdata(master);
787 777