summaryrefslogtreecommitdiff
path: root/src/drivers/spi/amic.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/spi/amic.c')
-rw-r--r--src/drivers/spi/amic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/spi/amic.c b/src/drivers/spi/amic.c
index 4cccc71197..63a68a5309 100644
--- a/src/drivers/spi/amic.c
+++ b/src/drivers/spi/amic.c
@@ -82,7 +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);
+ chunk_len = spi_crop_chunk(sizeof(cmd), chunk_len);
cmd[0] = CMD_A25_PP;
cmd[1] = (offset >> 16) & 0xff;
@@ -100,7 +100,7 @@ static int amic_write(struct spi_flash *flash,
goto out;
}
- ret = spi_flash_cmd_write(flash->spi, cmd, 4,
+ ret = spi_flash_cmd_write(flash->spi, cmd, sizeof(cmd),
buf + actual, chunk_len);
if (ret < 0) {
printk(BIOS_WARNING, "SF: AMIC Page Program failed\n");