From: Dhruva Gole Date: Wed, 1 Mar 2023 07:43:45 +0000 (+0530) Subject: spi: spi-mem: s/dummy/data buswidth check in dtr_supports_op() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=963b5da339a2ac8ad1451c9b84e746a2e26fd0d4;p=u-boot.git spi: spi-mem: s/dummy/data buswidth check in dtr_supports_op() This should have been op->data.buswidth instead as we check for octal bus width for the data related ops Also add explanation for why there is checks for 8D even data bytes Cc: Pratyush Yadav Reviewed-by: Pratyush Yadav Tested-by: Nikhil M Jain Signed-off-by: Dhruva Gole Reviewed-by: Jagan Teki --- diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c index 8e8995fc53..57a36f31a5 100644 --- a/drivers/spi/spi-mem.c +++ b/drivers/spi/spi-mem.c @@ -181,8 +181,12 @@ bool spi_mem_dtr_supports_op(struct spi_slave *slave, if (op->dummy.nbytes && op->dummy.buswidth == 8 && op->dummy.nbytes % 2) return false; + /* + * Transactions of odd length do not make sense for 8D-8D-8D mode + * because a byte is transferred in just half a cycle. + */ if (op->data.dir != SPI_MEM_NO_DATA && - op->dummy.buswidth == 8 && op->data.nbytes % 2) + op->data.buswidth == 8 && op->data.nbytes % 2) return false; return spi_mem_check_buswidth(slave, op);