From: Adrian Hunter Date: Fri, 12 Oct 2007 07:19:38 +0000 (+0300) Subject: [MTD] [OneNAND] Return only negative error codes X-Git-Tag: v2.6.24-rc1~1324^2~3 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=30a7eb298af849bae3050e0a3f4c130995da22b0;p=karo-tx-linux.git [MTD] [OneNAND] Return only negative error codes The OneNAND driver was confusing JFFS2 by returning positive error codes. Signed-off-by: Adrian Hunter Acked-by: Kyungmin Park Signed-off-by: David Woodhouse --- diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index f633941011a5..a8c426bf47a4 100644 --- a/drivers/mtd/onenand/onenand_base.c +++ b/drivers/mtd/onenand/onenand_base.c @@ -327,7 +327,7 @@ static int onenand_wait(struct mtd_info *mtd, int state) printk(KERN_ERR "onenand_wait: controller error = 0x%04x\n", ctrl); if (ctrl & ONENAND_CTRL_LOCK) printk(KERN_ERR "onenand_wait: it's locked error.\n"); - return ctrl; + return -EIO; } if (interrupt & ONENAND_INT_READ) { @@ -336,7 +336,7 @@ static int onenand_wait(struct mtd_info *mtd, int state) if (ecc & ONENAND_ECC_2BIT_ALL) { printk(KERN_ERR "onenand_wait: ECC error = 0x%04x\n", ecc); mtd->ecc_stats.failed++; - return ecc; + return -EBADMSG; } else if (ecc & ONENAND_ECC_1BIT_ALL) { printk(KERN_INFO "onenand_wait: correctable ECC error = 0x%04x\n", ecc); mtd->ecc_stats.corrected++;