summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-xcomm.c
diff options
context:
space:
mode:
authorStephen Warren <swarren@wwwdotorg.org>2013-05-21 20:36:35 -0600
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-05-29 20:48:17 +0100
commit24778be20f87d5aadb19624fc768b3159fa43efc (patch)
tree05124574b6d331f34938bbae09d4014fde7dca76 /drivers/spi/spi-xcomm.c
parent2922a8de996956893bb98e4aa91be9774c958336 (diff)
downloadlinux-24778be20f87d5aadb19624fc768b3159fa43efc.tar.bz2
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-xcomm.c')
-rw-r--r--drivers/spi/spi-xcomm.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/spi/spi-xcomm.c b/drivers/spi/spi-xcomm.c
index 4d3ec8b9f479..4258c712ad3c 100644
--- a/drivers/spi/spi-xcomm.c
+++ b/drivers/spi/spi-xcomm.c
@@ -76,7 +76,7 @@ static int spi_xcomm_setup_transfer(struct spi_xcomm *spi_xcomm,
{
unsigned int speed;
- if ((t->bits_per_word && t->bits_per_word != 8) || t->len > 62)
+ if (t->len > 62)
return -EINVAL;
speed = t->speed_hz ? t->speed_hz : spi->max_speed_hz;
@@ -209,14 +209,6 @@ static int spi_xcomm_transfer_one(struct spi_master *master,
return status;
}
-static int spi_xcomm_setup(struct spi_device *spi)
-{
- if (spi->bits_per_word != 8)
- return -EINVAL;
-
- return 0;
-}
-
static int spi_xcomm_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
@@ -233,8 +225,8 @@ static int spi_xcomm_probe(struct i2c_client *i2c,
master->num_chipselect = 16;
master->mode_bits = SPI_CPHA | SPI_CPOL | SPI_3WIRE;
+ master->bits_per_word_mask = SPI_BPW_MASK(8);
master->flags = SPI_MASTER_HALF_DUPLEX;
- master->setup = spi_xcomm_setup;
master->transfer_one_message = spi_xcomm_transfer_one;
master->dev.of_node = i2c->dev.of_node;
i2c_set_clientdata(i2c, master);