diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index c6388cbbe59..99909c8c546 100644 --- a/drivers/mtd/spi/spi_flash.c +++ b/drivers/mtd/spi/spi_flash.c @@ -560,7 +560,7 @@ int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 offset, return ret; bank_sel = flash->bank_curr; #endif - remain_len = ((SPI_FLASH_16MB_BOUN << flash->shift) * + remain_len = ((flash->size << flash->shift) * (bank_sel + 1)) - offset; if (len < remain_len) read_len = len;