[PATCH RFC v2 13/35] spi: cadence-qspi: Drop redundant checks

Miquel Raynal miquel.raynal at bootlin.com
Fri Nov 27 06:22:35 PST 2026


The core already sanitizes the spi-mem operations, these checks are
redundant so let's drop them.

Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
---
 drivers/spi/spi-cadence-quadspi.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index df7c04e0e2d2..97725ffeae93 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -476,9 +476,6 @@ static int cqspi_setup_opcode_ext(struct cqspi_flash_pdata *f_pdata,
 	unsigned int reg;
 	u8 ext;
 
-	if (op->cmd.nbytes != 2)
-		return -EINVAL;
-
 	/* Opcode extension is the LSB. */
 	ext = op->cmd.opcode & 0xff;
 
@@ -1515,11 +1512,7 @@ static bool cqspi_supports_mem_op(struct spi_mem *mem,
 
 	if (all_true) {
 		/* Right now we only support 8-8-8 DTR mode. */
-		if (op->cmd.nbytes && op->cmd.buswidth != 8)
-			return false;
-		if (op->addr.nbytes && op->addr.buswidth != 8)
-			return false;
-		if (op->data.nbytes && op->data.buswidth != 8)
+		if (op->cmd.buswidth != 8)
 			return false;
 
 		if (cqspi->is_rzn1)

-- 
2.56.0




More information about the linux-riscv mailing list