[PATCH 04/12] spi: ath79: Validate the dummy buswidth

Miquel Raynal miquel.raynal at bootlin.com
Thu Nov 26 11:10:23 PST 2026


The controller is single-lane. Reject operations asking for a dummy
buswidth other than one.

Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
---
 drivers/spi/spi-ath79.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-ath79.c b/drivers/spi/spi-ath79.c
index 1f5d0fb03917..36f21918d790 100644
--- a/drivers/spi/spi-ath79.c
+++ b/drivers/spi/spi-ath79.c
@@ -145,7 +145,8 @@ static int ath79_exec_mem_op(struct spi_mem *mem,
 
 	/* Only use for fast-read op. */
 	if (op->cmd.opcode != 0x0b || op->data.dir != SPI_MEM_DATA_IN ||
-	    op->addr.nbytes != 3 || op->dummy.nbytes != 1)
+	    op->addr.nbytes != 3 || op->dummy.nbytes != 1 ||
+	    op->dummy.buswidth != 1)
 		return -EOPNOTSUPP;
 
 	/* disable GPIO mode */

-- 
2.56.0




More information about the linux-riscv mailing list