Skip to content

Commit 93f1be8

Browse files
juhosggregkh
authored andcommitted
mtd: spinand: propagate spinand_wait() errors from spinand_write_page()
commit 091d9e3 upstream. 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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e26bd46 commit 93f1be8

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
@@ -618,7 +618,10 @@ static int spinand_write_page(struct spinand_device *spinand,
618618
SPINAND_WRITE_INITIAL_DELAY_US,
619619
SPINAND_WRITE_POLL_DELAY_US,
620620
&status);
621-
if (!ret && (status & STATUS_PROG_FAILED))
621+
if (ret)
622+
return ret;
623+
624+
if (status & STATUS_PROG_FAILED)
622625
return -EIO;
623626

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

0 commit comments

Comments
 (0)