linux/drivers/mtd/spi-nor
Brian Norris 0658620471 mtd: spi-nor: fix wrong "fully unlocked" test
In stm_unlock(), the test to determine whether we've fully unlocked the
flash checks for the lock length to be equal to the flash size. That is
a typo/think-o -- the condition actually means the flash is completely
*locked.* We should be using the inverse condition -- that the lock
length is 0 (i.e., no protection).

The result of this bug is that we never actually turn off the Status
Register Write Disable bit, even if the flash is completely unlocked.
Now we can.

Fixes: 47b8edbf0d ("mtd: spi-nor: disallow further writes to SR if WP# is low")
Reported-by: Giorgio <giorgio.nicole@arcor.de>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
2016-07-09 19:29:38 -07:00
..
fsl-quadspi.c mtd: spi-nor: stop passing around retlen 2016-06-01 17:22:52 -07:00
Kconfig mtd: spi-nor: fsl-quadspi: add support for layerscape 2016-03-07 11:46:44 -08:00
Makefile mtd: mtk-nor: new Mediatek serial flash controller driver 2015-11-20 17:35:16 -08:00
mtk-quadspi.c mtd: spi-nor: stop passing around retlen 2016-06-01 17:22:52 -07:00
nxp-spifi.c mtd: spi-nor: stop passing around retlen 2016-06-01 17:22:52 -07:00
spi-nor.c mtd: spi-nor: fix wrong "fully unlocked" test 2016-07-09 19:29:38 -07:00