From f8cf584f0eb74c788c7f27d2167dd90257d38f71 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 29 Jul 2025 07:13:09 +0000 Subject: [PATCH] Revert "spi: Add check for 8-bit transfer with 8 IO mode support" This reverts commit 82b29ee8ba906b651950ea73711595136478b6b6 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 --- drivers/spi/spi.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index b2810a2b8de5..2f2e908fb850 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -4010,13 +4010,10 @@ static int __spi_validate(struct spi_device *spi, struct spi_message *message) xfer->tx_nbits != SPI_NBITS_QUAD) return -EINVAL; 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; if ((xfer->tx_nbits == SPI_NBITS_QUAD) && - !(spi->mode & (SPI_TX_QUAD | SPI_TX_OCTAL))) - return -EINVAL; - if ((xfer->tx_nbits == SPI_NBITS_OCTAL) && - !(spi->mode & SPI_TX_OCTAL)) + !(spi->mode & SPI_TX_QUAD)) return -EINVAL; } /* 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) return -EINVAL; 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; if ((xfer->rx_nbits == SPI_NBITS_QUAD) && - !(spi->mode & (SPI_RX_QUAD | SPI_RX_OCTAL))) - return -EINVAL; - if ((xfer->rx_nbits == SPI_NBITS_OCTAL) && - !(spi->mode & SPI_RX_OCTAL)) + !(spi->mode & SPI_RX_QUAD)) return -EINVAL; }