From: Haibo Chen Date: Mon, 8 Dec 2025 09:14:14 +0000 (+0800) Subject: mtd: spi-nor: core: correct the op.dummy.nbytes when check read operations X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=756564a536ecd8c9d33edd89f0647a91a0b03587;p=thirdparty%2Fkernel%2Flinux.git mtd: spi-nor: core: correct the op.dummy.nbytes when check read operations 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 Reviewed-by: Pratyush Yadav Signed-off-by: Pratyush Yadav (Google) --- diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 8ffeb41c3e08a..e6c1fda61f579 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -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);