spi: Avoid checking console in SPL
authorSimon Glass <sjg@chromium.org>
Mon, 28 Feb 2022 19:08:28 +0000 (12:08 -0700)
committerTom Rini <trini@konsulko.com>
Wed, 6 Apr 2022 18:01:42 +0000 (14:01 -0400)
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>
drivers/mtd/spi/spi-nor-core.c

index a70fbda..3b7c817 100644 (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;