Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

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

authored by

Tokunori Ikegami and committed by
Richard Weinberger
8a9485ff 137e92fd

+1 -1
+1 -1
drivers/mtd/chips/cfi_cmdset_0002.c
··· 2417 2417 adr = cfi->addr_unlock1; 2418 2418 2419 2419 mutex_lock(&chip->mutex); 2420 - ret = get_chip(map, chip, adr, FL_WRITING); 2420 + ret = get_chip(map, chip, adr, FL_ERASING); 2421 2421 if (ret) { 2422 2422 mutex_unlock(&chip->mutex); 2423 2423 return ret;