Skip to content

Commit ad41b58

Browse files
BoughChengregkh
authored andcommitted
mtd: spi-nor: core: correct the op.dummy.nbytes when check read operations
[ Upstream commit 756564a ] When check read operation, need to setting the op.dummy.nbytes based on current read operation rather than the nor->read_proto. Fixes: 0e30f47 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 756afec commit ad41b58

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/mtd/spi-nor/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2393,7 +2393,7 @@ static int spi_nor_spimem_check_readop(struct spi_nor *nor,
23932393
/* convert the dummy cycles to the number of bytes */
23942394
op.dummy.nbytes = (read->num_mode_clocks + read->num_wait_states) *
23952395
op.dummy.buswidth / 8;
2396-
if (spi_nor_protocol_is_dtr(nor->read_proto))
2396+
if (spi_nor_protocol_is_dtr(read->proto))
23972397
op.dummy.nbytes *= 2;
23982398

23992399
return spi_nor_spimem_check_op(nor, &op);

0 commit comments

Comments
 (0)