Skip to contentSkip to conversation

MTD: LPC32xx SLC NAND driver: Add error handling to write function

PATCH New Roland Stigge 1 participant 1 message Jun 27, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MTD: LPC32xx SLC NAND driver: Add error handling to write function

This patch adds error handling to the lpc32xx_nand_write_page_syndrome() function.

---
 drivers/mtd/nand/lpc32xx_slc.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/mtd/nand/lpc32xx_slc.c +4 -1
index 7e2e78d..b27b3b3 100644
@@ -679,9 +679,12 @@ static int lpc32xx_nand_write_page_syndrome(struct mtd_info *mtd,
 {
 	struct lpc32xx_nand_host *host = chip->priv;
 	u8 *pb = chip->oob_poi + chip->ecc.layout->eccpos[0];
+	int error;
 
 	/* Write data, calculate ECC on outbound data */
-	lpc32xx_xfer(mtd, (u8 *)buf, chip->ecc.steps, 0);
+	error = lpc32xx_xfer(mtd, (u8 *)buf, chip->ecc.steps, 0);
+	if (error)
+		return error;
 
 	/*
 	 * The calculated ECC needs some manual work done to it before
Signature · 1 line
1.7.10.4