Skip to contentSkip to conversation

mtd: cfi_cmdset_0002: Fix do_erase_chip() to get chip as erasing mode

PATCH New Tokunori Ikegami 1 participant 1 message Aug 21, 2019 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: cfi_cmdset_0002: Fix do_erase_chip() to get chip as erasing mode

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.

---
 drivers/mtd/chips/cfi_cmdset_0002.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/chips/cfi_cmdset_0002.c +1 -1
index f4da7bd552e9..74b07a0bdaa2 100644
@@ -2344,7 +2344,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;
Signature · 1 line
2.11.0