From 564e532eea0d605114f3afe310ca673b366e8c14 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 28 Feb 2022 12:08:28 -0700 Subject: 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 --- drivers/mtd/spi/spi-nor-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index a70fbda4bbc..3b7c817c023 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -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; -- cgit v1.2.3