mtd: spi-nor: Add SNOR_F_NO_READ_CR warning

SPI Nor usually has a way to obtain the CR status and add a warning
to notify developers to make corresponding optimizations to avoid
forced SR writing, which may cause SR wear out.

Change-Id: Id0e32b94c33f564539cbbac3bb2147ad8227c3dd
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
This commit is contained in:
Jon Lin
2025-05-07 10:45:17 +08:00
committed by Tao Huang
parent 8a152b2e8c
commit 3cab45ddc1

View File

@@ -1647,8 +1647,10 @@ int spi_nor_sr2_bit1_quad_enable(struct spi_nor *nor)
{
int ret;
if (nor->flags & SNOR_F_NO_READ_CR)
if (nor->flags & SNOR_F_NO_READ_CR) {
dev_warn(nor->dev, "it is recommended to optimize the SNOR_F_NO_READ_CR!\n");
return spi_nor_write_16bit_cr_and_check(nor, SR2_QUAD_EN_BIT1);
}
ret = spi_nor_read_cr(nor, nor->bouncebuf);
if (ret)