Continuous mode is only supported for non-raw data reads, thus raw I/O
or non-raw writing requires only single flash page mapping.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevets...@iopsys.eu>
---
 drivers/mtd/nand/spi/core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index a76878abab1..07ea66825d5 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -1121,9 +1121,6 @@ static int spinand_create_dirmap(struct spinand_device 
*spinand,
        };
        struct spi_mem_dirmap_desc *desc;
 
-       if (spinand->cont_read_possible)
-               info.length = nanddev_eraseblock_size(nand);
-
        /* The plane number is passed in MSB just above the column address */
        info.offset = plane << fls(nand->memorg.pagesize);
 
@@ -1134,6 +1131,8 @@ static int spinand_create_dirmap(struct spinand_device 
*spinand,
 
        spinand->dirmaps[plane].wdesc = desc;
 
+       if (spinand->cont_read_possible)
+               info.length = nanddev_eraseblock_size(nand);
        info.op_tmpl = *spinand->op_templates.read_cache;
        desc = spi_mem_dirmap_create(spinand->slave, &info);
        if (IS_ERR(desc)) {
-- 
2.47.2

Reply via email to