]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
spi: spi-mem: s/dummy/data buswidth check in dtr_supports_op()
authorDhruva Gole <d-gole@ti.com>
Wed, 1 Mar 2023 07:43:45 +0000 (13:13 +0530)
committerJagan Teki <jagan@amarulasolutions.com>
Tue, 25 Apr 2023 17:25:51 +0000 (22:55 +0530)
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 <pratyush@kernel.org>
Reviewed-by: Pratyush Yadav <ptyadav@amazon.de>
Tested-by: Nikhil M Jain <n-jain1@ti.com>
Signed-off-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
drivers/spi/spi-mem.c

index 8e8995fc537f8528770e1132ad7f2469d7720955..57a36f31a5d3d8624547e491590d64c2c167d05d 100644 (file)
@@ -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);