spi: Avoid checking console in SPL

When SPI flash is used in SPL there is no console, so ctrlc() cannot be
called. Add a condition to fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2022-02-28 12:08:28 -07:00 committed by Tom Rini
parent a50b561333
commit 564e532eea

View File

@ -929,7 +929,7 @@ static int spi_nor_erase(struct mtd_info *mtd, struct erase_info *instr)
while (len) {
WATCHDOG_RESET();
if (ctrlc()) {
if (!IS_ENABLED(CONFIG_SPL_BUILD) && ctrlc()) {
addr_known = false;
ret = -EINTR;
goto erase_err;