提交 e2bdae06 编写于 作者: J Jonas Gorski 提交者: Mark Brown

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: NJonas Gorski <jogo@openwrt.org>
Acked-by: NFlorian Fainelli <florian@openwrt.org>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 52f83bbd
...@@ -151,8 +151,11 @@ static void bcm63xx_spi_setup_transfer(struct spi_device *spi, ...@@ -151,8 +151,11 @@ static void bcm63xx_spi_setup_transfer(struct spi_device *spi,
static int bcm63xx_spi_setup(struct spi_device *spi) static int bcm63xx_spi_setup(struct spi_device *spi)
{ {
if (!spi->bits_per_word) if (spi->bits_per_word != 8) {
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; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册