summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-bcm63xx.c
diff options
context:
space:
mode:
authorJonas Gorski <jogo@openwrt.org>2013-03-12 00:13:42 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-03-12 19:14:45 +0000
commite2bdae06329ef3fb8918032735cd963efc701b7e (patch)
treee0161a3b7168f6f73836393ab5d97b96d039ef08 /drivers/spi/spi-bcm63xx.c
parent52f83bbd65c1178ac989e511943ecd6e0c5f8ad8 (diff)
downloadlwn-e2bdae06329ef3fb8918032735cd963efc701b7e.tar.gz
lwn-e2bdae06329ef3fb8918032735cd963efc701b7e.zip
spi/bcm63xx: check spi bits_per_word in spi_setup
Instead of fixing up the bits_per_word (which the spi subsystem already does for us), check it for supported values. Signed-off-by: Jonas Gorski <jogo@openwrt.org> Acked-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/spi/spi-bcm63xx.c')
-rw-r--r--drivers/spi/spi-bcm63xx.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c
index 04c460e8bd27..b64229ca7f54 100644
--- a/drivers/spi/spi-bcm63xx.c
+++ b/drivers/spi/spi-bcm63xx.c
@@ -151,8 +151,11 @@ static void bcm63xx_spi_setup_transfer(struct spi_device *spi,
static int bcm63xx_spi_setup(struct spi_device *spi)
{
- if (!spi->bits_per_word)
- spi->bits_per_word = 8;
+ if (spi->bits_per_word != 8) {
+ dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n",
+ __func__, spi->bits_per_word);
+ return -EINVAL;
+ }
return 0;
}