diff options
Diffstat (limited to 'src/drivers/spi/amic.c')
-rw-r--r-- | src/drivers/spi/amic.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/drivers/spi/amic.c b/src/drivers/spi/amic.c index fa17036e85..4cccc71197 100644 --- a/src/drivers/spi/amic.c +++ b/src/drivers/spi/amic.c @@ -70,7 +70,7 @@ static int amic_write(struct spi_flash *flash, int ret; u8 cmd[4]; - page_size = min(1 << amic->params->l2_page_size, CONTROLLER_PAGE_LIMIT); + page_size = 1 << amic->params->l2_page_size; byte_addr = offset % page_size; flash->spi->rw = SPI_WRITE_FLAG; @@ -82,6 +82,7 @@ static int amic_write(struct spi_flash *flash, for (actual = 0; actual < len; actual += chunk_len) { chunk_len = min(len - actual, page_size - byte_addr); + chunk_len = min(chunk_len, CONTROLLER_PAGE_LIMIT); cmd[0] = CMD_A25_PP; cmd[1] = (offset >> 16) & 0xff; |