]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: spi-nor: Check that BP bits are set properly
authorAaron Sierra <asierra@xes-inc.com>
Tue, 5 Dec 2017 18:13:44 +0000 (12:13 -0600)
committerCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
Tue, 12 Dec 2017 23:36:00 +0000 (00:36 +0100)
commit0e4026a615e2f7144390df546356212df2462da3
treedc1a09cb8202e95f8aa4c3ecf0800d3f9a57e2af
parent5a36607d9d4b870028c9decdce87180f8af1c993
mtd: spi-nor: Check that BP bits are set properly

Previously, the lock and unlock functions returned success even if the
BP bits were not actually updated in the status register due to
hardware write protection. Introduce write_sr_and_check() to write and
read back the status register to ensure the desired BP bits are
actually set as requested.

Signed-off-by: Joe Schultz <jschultz@xes-inc.com>
Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>
drivers/mtd/spi-nor/spi-nor.c