[PATCH v5 2/2] mtd: spi-nor: Stop reporting warning message when soft reset is not suported
AceLan Kao
acelan.kao at canonical.com
Wed Nov 8 01:43:03 PST 2023
From: "Chia-Lin Kao (AceLan)" <acelan.kao at canonical.com>
When the software reset command isn't supported, we now stop reporting
the warning message to avoid unnecessary warnings and potential confusion.
Reviewed-by: Dhruva Gole <d-gole at ti.com>
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao at canonical.com>
---
v2. only lower the priority for the not supported failure
v3. replace ENOTSUPP with EOPNOTSUPP and check the first command only
v4. move the version information below the '---' line
v5. remove dev_warn if soft reset operation is not supported
---
drivers/mtd/spi-nor/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index 1b0c6770c14e..75bac1418045 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -3252,7 +3252,8 @@ static void spi_nor_soft_reset(struct spi_nor *nor)
ret = spi_mem_exec_op(nor->spimem, &op);
if (ret) {
- dev_warn(nor->dev, "Software reset failed: %d\n", ret);
+ if (ret != -EOPNOTSUPP)
+ dev_warn(nor->dev, "Software reset failed: %d\n", ret);
return;
}
--
2.34.1
More information about the linux-mtd
mailing list