diff options
author | Tudor Ambarus <tudor.ambarus@microchip.com> | 2022-02-28 18:33:34 +0200 |
---|---|---|
committer | Tudor Ambarus <tudor.ambarus@microchip.com> | 2022-03-08 10:36:56 +0200 |
commit | 151c6b49d679872d6fc0b50e0ad96303091694a2 (patch) | |
tree | 51dd9995c4991aaae55d31a181375b99511d571c /drivers/mtd/devices | |
parent | 3c552889e431cf5c9680bb7de1c5d16bcc90b033 (diff) | |
download | linux-stable-151c6b49d679872d6fc0b50e0ad96303091694a2.tar.gz linux-stable-151c6b49d679872d6fc0b50e0ad96303091694a2.tar.bz2 linux-stable-151c6b49d679872d6fc0b50e0ad96303091694a2.zip |
mtd: spi-nor: Skip erase logic when SPI_NOR_NO_ERASE is set
Even if SPI_NOR_NO_ERASE was set, one could still send erase opcodes
to the flash. It is not recommended to send unsupported opcodes to
flashes. Fix the logic and do not set mtd->_erase when SPI_NOR_NO_ERASE
is specified. With this users will not be able to issue erase opcodes to
flashes and instead they will recive an -ENOTSUPP error.
Fixes: b199489d37b2 ("mtd: spi-nor: add the framework for SPI NOR")
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Michael Walle <michael@walle.cc>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20220228163334.277730-1-tudor.ambarus@microchip.com
Diffstat (limited to 'drivers/mtd/devices')
0 files changed, 0 insertions, 0 deletions