summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorGabor Juhos <[email protected]>2025-09-30 03:21:04 +0300
committerMichael Trimarchi <[email protected]>2025-10-05 20:26:24 +0200
commitf61362c24f5d827005cca5b46887400625faf540 (patch)
tree495ae54701657cb8dbfc6e6cfc11fc0daa0ba027 /drivers
parentccc6b42adcabd0fb16103410985dae7d96f2036a (diff)
mtd: spinand: propagate spinand_wait() errors from spinand_write_page()
Since commit 3d1f08b032dc ("mtd: spinand: Use the external ECC engine logic") the spinand_write_page() function ignores the errors returned by spinand_wait(). Change the code to propagate those up to the stack as it was done before the offending change. This is a port of linux commit 091d9e35b85b ("mtd: spinand: propagate spinand_wait() errors from spinand_write_page()") Signed-off-by: Gabor Juhos <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Signed-off-by: Mikhail Kshevetskiy <[email protected]> # U-Boot port Signed-off-by: Michael Trimarchi <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/nand/spi/core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index daf6efb87d8..3e21a06dd0f 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -691,7 +691,10 @@ int spinand_write_page(struct spinand_device *spinand,
SPINAND_WRITE_INITIAL_DELAY_US,
SPINAND_WRITE_POLL_DELAY_US,
&status);
- if (!ret && (status & STATUS_PROG_FAILED))
+ if (ret)
+ return ret;
+
+ if (status & STATUS_PROG_FAILED)
return -EIO;
return spinand_ondie_ecc_finish_io_req(nand, (struct nand_page_io_req *)req);