]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mtd: spi-nor: core: correct the op.dummy.nbytes when check read operations
authorHaibo Chen <haibo.chen@nxp.com>
Mon, 8 Dec 2025 09:14:14 +0000 (17:14 +0800)
committerPratyush Yadav (Google) <pratyush@kernel.org>
Fri, 13 Mar 2026 10:28:17 +0000 (10:28 +0000)
When check read operation, need to setting the op.dummy.nbytes based
on current read operation rather than the nor->read_proto.

Fixes: 0e30f47232ab ("mtd: spi-nor: add support for DTR protocol")
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>
drivers/mtd/spi-nor/core.c

index 8ffeb41c3e08a6a8bf404b9c0520684401b8b9e2..e6c1fda61f5790766a8710a9524d5b6b18b9c911 100644 (file)
@@ -2393,7 +2393,7 @@ static int spi_nor_spimem_check_readop(struct spi_nor *nor,
        /* convert the dummy cycles to the number of bytes */
        op.dummy.nbytes = (read->num_mode_clocks + read->num_wait_states) *
                          op.dummy.buswidth / 8;
-       if (spi_nor_protocol_is_dtr(nor->read_proto))
+       if (spi_nor_protocol_is_dtr(read->proto))
                op.dummy.nbytes *= 2;
 
        return spi_nor_spimem_check_op(nor, &op);