devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MTD: LPC32xx SLC NAND driver: Add error handling to write function
@ 2012-06-27 12:13 Roland Stigge
  0 siblings, 0 replies; only message in thread
From: Roland Stigge @ 2012-06-27 12:13 UTC (permalink / raw)
  To: dedekind1, linux-mtd, linux-kernel, linux-doc, devicetree-discuss,
	dwmw2, kevin.wells, srinivas.bakki, linux-arm-kernel, hechtb,
	lars, b32955, leiwen, linux
  Cc: Roland Stigge

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

Signed-off-by: Roland Stigge <stigge@antcom.de>

---
 drivers/mtd/nand/lpc32xx_slc.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/lpc32xx_slc.c b/drivers/mtd/nand/lpc32xx_slc.c
index 7e2e78d..b27b3b3 100644
--- a/drivers/mtd/nand/lpc32xx_slc.c
+++ b/drivers/mtd/nand/lpc32xx_slc.c
@@ -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
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-06-27 12:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-27 12:13 [PATCH] MTD: LPC32xx SLC NAND driver: Add error handling to write function Roland Stigge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).