mtd: cfi_cmdset_0002: Fix do_erase_chip() to get chip as erasing mode
authorTokunori Ikegami <ikegami.t@gmail.com>
Wed, 21 Aug 2019 16:46:51 +0000 (01:46 +0900)
committerRichard Weinberger <richard@nod.at>
Sun, 15 Sep 2019 21:51:07 +0000 (23:51 +0200)
The chip state is set to erasing by the function after getting chip.
So it should be to get chip as erasing mode at first.
But previously it was to get chip as writing mode then fix as erasing.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Cc: linux-mtd@lists.infradead.org
Signed-off-by: Richard Weinberger <richard@nod.at>
drivers/mtd/chips/cfi_cmdset_0002.c

index 537c8b097a9c65d82cc0ba8569efef06717d5d58..cf8c8be40a9cdae10f7d7a07f8270cbdd13c6892 100644 (file)
@@ -2417,7 +2417,7 @@ static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip)
        adr = cfi->addr_unlock1;
 
        mutex_lock(&chip->mutex);
-       ret = get_chip(map, chip, adr, FL_WRITING);
+       ret = get_chip(map, chip, adr, FL_ERASING);
        if (ret) {
                mutex_unlock(&chip->mutex);
                return ret;