diff options
author | Marek BehĂșn <marek.behun@nic.cz> | 2021-10-05 16:56:04 +0300 |
---|---|---|
committer | Jagan Teki <jagan@amarulasolutions.com> | 2021-10-23 13:17:33 +0300 |
commit | 1fd5e67595367126c9f76b3f0c47db21523665c3 (patch) | |
tree | d5ef74f23e80f6aecc97ce58b4d60ff77b89b02d /drivers | |
parent | ff0000b47d7945701b2f9d17cc301b54452d499b (diff) | |
download | u-boot-1fd5e67595367126c9f76b3f0c47db21523665c3.tar.xz |
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 <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/spi/spi-nor-core.c | 5 |
1 files changed, 5 insertions, 0 deletions
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) |