From: Marek BehĂșn Date: Tue, 5 Oct 2021 13:56:04 +0000 (+0200) Subject: mtd: spi-nor-core: Check for ctrlc() in spi_nor_erase() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=1fd5e67595367126c9f76b3f0c47db21523665c3;p=u-boot.git mtd: spi-nor-core: Check for ctrlc() in spi_nor_erase() May it possible to interrupt the spi_nor_erase() function. Signed-off-by: Marek BehĂșn Reviewed-by: Simon Glass Tested-by: Masami Hiramatsu --- diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index 2c71866bca..a85759967b 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -929,6 +929,11 @@ static int spi_nor_erase(struct mtd_info *mtd, struct erase_info *instr) while (len) { WATCHDOG_RESET(); + if (ctrlc()) { + addr_known = false; + ret = -EINTR; + goto erase_err; + } #ifdef CONFIG_SPI_FLASH_BAR ret = write_bar(nor, addr); if (ret < 0)