]> Git Repo - J-u-boot.git/commitdiff
mtd: spi-nor-core: Check for ctrlc() in spi_nor_erase()
authorMarek Behún <[email protected]>
Tue, 5 Oct 2021 13:56:04 +0000 (15:56 +0200)
committerJagan Teki <[email protected]>
Sat, 23 Oct 2021 10:17:33 +0000 (15:47 +0530)
May it possible to interrupt the spi_nor_erase() function.

Signed-off-by: Marek Behún <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Tested-by: Masami Hiramatsu <[email protected]>
drivers/mtd/spi/spi-nor-core.c

index 2c71866bcacf8becb277cd8c1564e50d88ac70a2..a85759967b00abf59151c6dfc6dd1299085b2cde 100644 (file)
@@ -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)
This page took 0.032697 seconds and 4 git commands to generate.