Skip to content

Commit 091d9e3

Browse files
juhosgmiquelraynal
authored andcommitted
mtd: spinand: propagate spinand_wait() errors from spinand_write_page()
Since commit 3d1f08b ("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. Cc: [email protected] Fixes: 3d1f08b ("mtd: spinand: Use the external ECC engine logic") Signed-off-by: Gabor Juhos <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
1 parent 6c4dab3 commit 091d9e3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/mtd/nand/spi/core.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,10 @@ int spinand_write_page(struct spinand_device *spinand,
688688
SPINAND_WRITE_INITIAL_DELAY_US,
689689
SPINAND_WRITE_POLL_DELAY_US,
690690
&status);
691-
if (!ret && (status & STATUS_PROG_FAILED))
691+
if (ret)
692+
return ret;
693+
694+
if (status & STATUS_PROG_FAILED)
692695
return -EIO;
693696

694697
return nand_ecc_finish_io_req(nand, (struct nand_page_io_req *)req);

0 commit comments

Comments
 (0)