drivers: flash: spi_nor: select largest valid erase operation
The spi_nor erase op selection was based on the alignment of the end of the region to be erased. This prevented larger erase operations being selected in many cases Closes #60904 Signed-off-by: Joshua Crawford <joshua.crawford@levno.com>
This commit is contained in:
parent
b774b97ff9
commit
ea2dd9fc65
1 changed files with 1 additions and 1 deletions
|
@ -775,7 +775,7 @@ static int spi_nor_erase(const struct device *dev, off_t addr, size_t size)
|
||||||
|
|
||||||
if ((etp->exp != 0)
|
if ((etp->exp != 0)
|
||||||
&& SPI_NOR_IS_ALIGNED(addr, etp->exp)
|
&& SPI_NOR_IS_ALIGNED(addr, etp->exp)
|
||||||
&& SPI_NOR_IS_ALIGNED(size, etp->exp)
|
&& (size >= BIT(etp->exp))
|
||||||
&& ((bet == NULL)
|
&& ((bet == NULL)
|
||||||
|| (etp->exp > bet->exp))) {
|
|| (etp->exp > bet->exp))) {
|
||||||
bet = etp;
|
bet = etp;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue