MLK-20233 imx8: Fix QSPI read in container parser

The check for CONFIG_SPL_SPI_LOAD is fixed, get rid of ret local variable
(that's actually a bug) and fix the length for the spi_flash_read call.

Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
This commit is contained in:
Abel Vesa 2018-11-07 18:12:22 +02:00
parent a37a72c84f
commit 32adc4aed8
1 changed files with 4 additions and 3 deletions

View File

@ -55,12 +55,13 @@ static int read(int start, int len, void *load_addr)
return -EIO; return -EIO;
} }
} }
#elif CONFIG_SPL_SPI_LOAD #endif
#ifdef CONFIG_SPL_SPI_LOAD
if (current_dev_type == QSPI_DEV) { if (current_dev_type == QSPI_DEV) {
struct spi_flash *flash = (struct spi_flash *)device; struct spi_flash *flash = (struct spi_flash *)device;
int ret = spi_flash_read(flash, start, ret = spi_flash_read(flash, start,
CONTAINER_HDR_ALIGNMENT, load_addr); len, load_addr);
if (ret != 0) { if (ret != 0) {
debug("Read container image from QSPI failed\n"); debug("Read container image from QSPI failed\n");
return -EIO; return -EIO;