aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-omap-100k.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-omap-100k.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-omap-100k.c')
-rw-r--r--drivers/spi/spi-omap-100k.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/spi/spi-omap-100k.c b/drivers/spi/spi-omap-100k.c
index 78d29a18dcc4..9137fcc4f99b 100644
--- a/drivers/spi/spi-omap-100k.c
+++ b/drivers/spi/spi-omap-100k.c
@@ -298,12 +298,6 @@ static int omap1_spi100k_setup(struct spi_device *spi)
298 struct omap1_spi100k *spi100k; 298 struct omap1_spi100k *spi100k;
299 struct omap1_spi100k_cs *cs = spi->controller_state; 299 struct omap1_spi100k_cs *cs = spi->controller_state;
300 300
301 if (spi->bits_per_word < 4 || spi->bits_per_word > 32) {
302 dev_dbg(&spi->dev, "setup: unsupported %d bit words\n",
303 spi->bits_per_word);
304 return -EINVAL;
305 }
306
307 spi100k = spi_master_get_devdata(spi->master); 301 spi100k = spi_master_get_devdata(spi->master);
308 302
309 if (!cs) { 303 if (!cs) {
@@ -451,10 +445,7 @@ static int omap1_spi100k_transfer(struct spi_device *spi, struct spi_message *m)
451 unsigned len = t->len; 445 unsigned len = t->len;
452 446
453 if (t->speed_hz > OMAP1_SPI100K_MAX_FREQ 447 if (t->speed_hz > OMAP1_SPI100K_MAX_FREQ
454 || (len && !(rx_buf || tx_buf)) 448 || (len && !(rx_buf || tx_buf))) {
455 || (t->bits_per_word &&
456 ( t->bits_per_word < 4
457 || t->bits_per_word > 32))) {
458 dev_dbg(&spi->dev, "transfer: %d Hz, %d %s%s, %d bpw\n", 449 dev_dbg(&spi->dev, "transfer: %d Hz, %d %s%s, %d bpw\n",
459 t->speed_hz, 450 t->speed_hz,
460 len, 451 len,
@@ -509,6 +500,7 @@ static int omap1_spi100k_probe(struct platform_device *pdev)
509 master->cleanup = NULL; 500 master->cleanup = NULL;
510 master->num_chipselect = 2; 501 master->num_chipselect = 2;
511 master->mode_bits = MODEBITS; 502 master->mode_bits = MODEBITS;
503 master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32);
512 504
513 dev_set_drvdata(&pdev->dev, master); 505 dev_set_drvdata(&pdev->dev, master);
514 506