Commit 4084c8ca authored by Christophe Leroy's avatar Christophe Leroy Committed by Mark Brown

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: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/9ace69a8085e22fafd9159e99edd7bbfae2f9940.1680371809.git.christophe.leroy@csgroup.euSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 99aebb3c
...@@ -263,18 +263,10 @@ static int fsl_spi_bufs(struct spi_device *spi, struct spi_transfer *t, ...@@ -263,18 +263,10 @@ static int fsl_spi_bufs(struct spi_device *spi, struct spi_transfer *t,
if (t->bits_per_word) if (t->bits_per_word)
bits_per_word = t->bits_per_word; bits_per_word = t->bits_per_word;
if (bits_per_word > 8) { if (bits_per_word > 8)
/* invalid length? */
if (len & 1)
return -EINVAL;
len /= 2; len /= 2;
} if (bits_per_word > 16)
if (bits_per_word > 16) {
/* invalid length? */
if (len & 1)
return -EINVAL;
len /= 2; len /= 2;
}
mpc8xxx_spi->tx = t->tx_buf; mpc8xxx_spi->tx = t->tx_buf;
mpc8xxx_spi->rx = t->rx_buf; mpc8xxx_spi->rx = t->rx_buf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment