Revert "spi: Add check for 8-bit transfer with 8 IO mode support"

This reverts commit 82b29ee8ba which is
commit 710505212e3272396394f8cf78e3ddfd05df3f22 upstream.

It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.

Bug: 161946584
Change-Id: I6727c91fc52be0c25b57d9b7f0ba14118b109b8d
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2025-07-29 07:13:09 +00:00
parent 0a94163e88
commit f8cf584f0e

View File

@@ -4010,13 +4010,10 @@ static int __spi_validate(struct spi_device *spi, struct spi_message *message)
xfer->tx_nbits != SPI_NBITS_QUAD) xfer->tx_nbits != SPI_NBITS_QUAD)
return -EINVAL; return -EINVAL;
if ((xfer->tx_nbits == SPI_NBITS_DUAL) && if ((xfer->tx_nbits == SPI_NBITS_DUAL) &&
!(spi->mode & (SPI_TX_DUAL | SPI_TX_QUAD | SPI_TX_OCTAL))) !(spi->mode & (SPI_TX_DUAL | SPI_TX_QUAD)))
return -EINVAL; return -EINVAL;
if ((xfer->tx_nbits == SPI_NBITS_QUAD) && if ((xfer->tx_nbits == SPI_NBITS_QUAD) &&
!(spi->mode & (SPI_TX_QUAD | SPI_TX_OCTAL))) !(spi->mode & SPI_TX_QUAD))
return -EINVAL;
if ((xfer->tx_nbits == SPI_NBITS_OCTAL) &&
!(spi->mode & SPI_TX_OCTAL))
return -EINVAL; return -EINVAL;
} }
/* Check transfer rx_nbits */ /* Check transfer rx_nbits */
@@ -4028,13 +4025,10 @@ static int __spi_validate(struct spi_device *spi, struct spi_message *message)
xfer->rx_nbits != SPI_NBITS_QUAD) xfer->rx_nbits != SPI_NBITS_QUAD)
return -EINVAL; return -EINVAL;
if ((xfer->rx_nbits == SPI_NBITS_DUAL) && if ((xfer->rx_nbits == SPI_NBITS_DUAL) &&
!(spi->mode & (SPI_RX_DUAL | SPI_RX_QUAD | SPI_RX_OCTAL))) !(spi->mode & (SPI_RX_DUAL | SPI_RX_QUAD)))
return -EINVAL; return -EINVAL;
if ((xfer->rx_nbits == SPI_NBITS_QUAD) && if ((xfer->rx_nbits == SPI_NBITS_QUAD) &&
!(spi->mode & (SPI_RX_QUAD | SPI_RX_OCTAL))) !(spi->mode & SPI_RX_QUAD))
return -EINVAL;
if ((xfer->rx_nbits == SPI_NBITS_OCTAL) &&
!(spi->mode & SPI_RX_OCTAL))
return -EINVAL; return -EINVAL;
} }