mtd: spi-nor: sst: remove global protection flag
authorMichael Walle <michael@walle.cc>
Thu, 3 Dec 2020 16:29:56 +0000 (17:29 +0100)
committerVignesh Raghavendra <vigneshr@ti.com>
Mon, 7 Dec 2020 17:27:30 +0000 (22:57 +0530)
commita833383732116c2afe665520bbe6951999631ef1
tree9e547608543e304112d8868bbdc7a542e13e3345
parente6204d4620276398ed7317d64c369813a1f96615
mtd: spi-nor: sst: remove global protection flag

This is considered bad for the following reasons:
 (1) We only support the block protection with BPn bits for write
     protection. Not all SST parts support this.
 (2) Newly added flash chip will automatically inherit the "has
     locking" support and thus needs to explicitly tested. Better
     be opt-in instead of opt-out.
 (3) There are already supported flashes which doesn't support
     the locking scheme. So I assume this wasn't properly tested
     before adding that chip; which enforces my previous argument
     that locking support should be an opt-in.

Remove the global flag and add individual flags to all flashes
which supports BP locking. In particular the following flashes
don't support the BP scheme:
 - SST26VF016B
 - SST26WF016B
 - SST26VF064B

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Link: https://lore.kernel.org/r/20201203162959.29589-5-michael@walle.cc
drivers/mtd/spi-nor/sst.c