Commit 151c6b4
committed
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: b199489 ("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.com1 parent 3c55288 commit 151c6b4
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2948 | 2948 | | |
2949 | 2949 | | |
2950 | 2950 | | |
| 2951 | + | |
| 2952 | + | |
2951 | 2953 | | |
2952 | 2954 | | |
2953 | 2955 | | |
2954 | | - | |
2955 | 2956 | | |
2956 | 2957 | | |
2957 | 2958 | | |
| |||
0 commit comments