1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 07:02:34 +02:00

dediprog.c: Fix layering violation of default_spi_read

default_spi_read() calls spi_read_chunked() with the correct
max_read value of 16 set in the spi master struct.

Change-Id: Ic0897f74056e3d723a33c063ed0bd8cb6e88ba45
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/46232
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Sam McNally <sammc@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Edward O'Callaghan 2020-10-09 12:56:53 +11:00 committed by Edward O'Callaghan
parent 90ac9872cd
commit 91c10aebb3

View File

@ -545,7 +545,7 @@ static int dediprog_spi_read(struct flashctx *flash, uint8_t *buf, unsigned int
if (residue) {
msg_pdbg("Slow read for partial block from 0x%x, length 0x%x\n",
start, residue);
ret = spi_read_chunked(flash, buf, start, residue, 16);
ret = default_spi_read(flash, buf, start, residue);
if (ret)
goto err;
}
@ -560,8 +560,8 @@ static int dediprog_spi_read(struct flashctx *flash, uint8_t *buf, unsigned int
if (len != 0) {
msg_pdbg("Slow read for partial block from 0x%x, length 0x%x\n",
start, len);
ret = spi_read_chunked(flash, buf + residue + bulklen,
start + residue + bulklen, len, 16);
ret = default_spi_read(flash, buf + residue + bulklen,
start + residue + bulklen, len);
if (ret)
goto err;
}