diff options
author | Christophe Leroy <christophe.leroy@csgroup.eu> | 2023-04-01 19:59:50 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-04-05 12:33:36 +0100 |
commit | 4084c8ca1266ba09554de8df19aac82b6dd2e079 (patch) | |
tree | 334d2bb8a8e71d43241e8f261a1761ceee8b93f1 /drivers/spi/spi-fsl-spi.c | |
parent | 99aebb3c1b418d865461aa0813ef1b55285cbda4 (diff) | |
download | lwn-4084c8ca1266ba09554de8df19aac82b6dd2e079.tar.gz lwn-4084c8ca1266ba09554de8df19aac82b6dd2e079.zip |
spi: fsl-spi: No need to check transfer length versus word size
The verification is already do in the SPI core by function
__spi_validate(), not it to check it again in fsl_spi_bufs().
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/9ace69a8085e22fafd9159e99edd7bbfae2f9940.1680371809.git.christophe.leroy@csgroup.eu
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-fsl-spi.c')
-rw-r--r-- | drivers/spi/spi-fsl-spi.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c index e64c5f5452d0..106fe60a0a50 100644 --- a/drivers/spi/spi-fsl-spi.c +++ b/drivers/spi/spi-fsl-spi.c @@ -263,18 +263,10 @@ static int fsl_spi_bufs(struct spi_device *spi, struct spi_transfer *t, if (t->bits_per_word) bits_per_word = t->bits_per_word; - if (bits_per_word > 8) { - /* invalid length? */ - if (len & 1) - return -EINVAL; + if (bits_per_word > 8) len /= 2; - } - if (bits_per_word > 16) { - /* invalid length? */ - if (len & 1) - return -EINVAL; + if (bits_per_word > 16) len /= 2; - } mpc8xxx_spi->tx = t->tx_buf; mpc8xxx_spi->rx = t->rx_buf; |