Commit 58d8bebea57b519cb606a59dc1263556e8746119
Committed by
Mark Brown
1 parent
e2bdae0632
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
spi/bcm63xx: simplify bcm63xx_spi_check_transfer
bcm63xx_spi_check_transfer is only called from one place that has t always set, so directly check the transfer's bits_per_word. Signed-off-by: Jonas Gorski <jogo@openwrt.org> Acked-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Showing 1 changed file with 2 additions and 5 deletions Side-by-side Diff
drivers/spi/spi-bcm63xx.c
... | ... | @@ -96,12 +96,9 @@ |
96 | 96 | static int bcm63xx_spi_check_transfer(struct spi_device *spi, |
97 | 97 | struct spi_transfer *t) |
98 | 98 | { |
99 | - u8 bits_per_word; | |
100 | - | |
101 | - bits_per_word = (t) ? t->bits_per_word : spi->bits_per_word; | |
102 | - if (bits_per_word != 8) { | |
99 | + if (t->bits_per_word != 8) { | |
103 | 100 | dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n", |
104 | - __func__, bits_per_word); | |
101 | + __func__, t->bits_per_word); | |
105 | 102 | return -EINVAL; |
106 | 103 | } |
107 | 104 |