aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Gorski <jogo@openwrt.org>2013-03-11 19:13:42 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-03-12 15:14:45 -0400
commite2bdae06329ef3fb8918032735cd963efc701b7e (patch)
treee0161a3b7168f6f73836393ab5d97b96d039ef08
parent52f83bbd65c1178ac989e511943ecd6e0c5f8ad8 (diff)
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>
-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,
151 151
152static int bcm63xx_spi_setup(struct spi_device *spi) 152static int bcm63xx_spi_setup(struct spi_device *spi)
153{ 153{
154 if (!spi->bits_per_word) 154 if (spi->bits_per_word != 8) {
155 spi->bits_per_word = 8; 155 dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n",
156 __func__, spi->bits_per_word);
157 return -EINVAL;
158 }
156 159
157 return 0; 160 return 0;
158} 161}