aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-atmel.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-atmel.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-atmel.c')
-rw-r--r--drivers/spi/spi-atmel.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 380387a47b1d..31cfc8711547 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -1268,13 +1268,6 @@ static int atmel_spi_setup(struct spi_device *spi)
1268 return -EINVAL; 1268 return -EINVAL;
1269 } 1269 }
1270 1270
1271 if (bits < 8 || bits > 16) {
1272 dev_dbg(&spi->dev,
1273 "setup: invalid bits_per_word %u (8 to 16)\n",
1274 bits);
1275 return -EINVAL;
1276 }
1277
1278 /* see notes above re chipselect */ 1271 /* see notes above re chipselect */
1279 if (!atmel_spi_is_v2(as) 1272 if (!atmel_spi_is_v2(as)
1280 && spi->chip_select == 0 1273 && spi->chip_select == 0
@@ -1515,7 +1508,7 @@ static int atmel_spi_probe(struct platform_device *pdev)
1515 1508
1516 /* the spi->mode bits understood by this driver: */ 1509 /* the spi->mode bits understood by this driver: */
1517 master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; 1510 master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
1518 1511 master->bits_per_word_mask = SPI_BPW_RANGE_MASK(8, 16);
1519 master->dev.of_node = pdev->dev.of_node; 1512 master->dev.of_node = pdev->dev.of_node;
1520 master->bus_num = pdev->id; 1513 master->bus_num = pdev->id;
1521 master->num_chipselect = master->dev.of_node ? 0 : 4; 1514 master->num_chipselect = master->dev.of_node ? 0 : 4;