Commit 30a7eb29 authored by Adrian Hunter's avatar Adrian Hunter Committed by David Woodhouse

[MTD] [OneNAND] Return only negative error codes

The OneNAND driver was confusing JFFS2 by returning positive error
codes.
Signed-off-by: default avatarAdrian Hunter <ext-adrian.hunter@nokia.com>
Acked-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent 34627f0e
...@@ -327,7 +327,7 @@ static int onenand_wait(struct mtd_info *mtd, int state) ...@@ -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); printk(KERN_ERR "onenand_wait: controller error = 0x%04x\n", ctrl);
if (ctrl & ONENAND_CTRL_LOCK) if (ctrl & ONENAND_CTRL_LOCK)
printk(KERN_ERR "onenand_wait: it's locked error.\n"); printk(KERN_ERR "onenand_wait: it's locked error.\n");
return ctrl; return -EIO;
} }
if (interrupt & ONENAND_INT_READ) { if (interrupt & ONENAND_INT_READ) {
...@@ -336,7 +336,7 @@ static int onenand_wait(struct mtd_info *mtd, int state) ...@@ -336,7 +336,7 @@ static int onenand_wait(struct mtd_info *mtd, int state)
if (ecc & ONENAND_ECC_2BIT_ALL) { if (ecc & ONENAND_ECC_2BIT_ALL) {
printk(KERN_ERR "onenand_wait: ECC error = 0x%04x\n", ecc); printk(KERN_ERR "onenand_wait: ECC error = 0x%04x\n", ecc);
mtd->ecc_stats.failed++; mtd->ecc_stats.failed++;
return ecc; return -EBADMSG;
} else if (ecc & ONENAND_ECC_1BIT_ALL) { } else if (ecc & ONENAND_ECC_1BIT_ALL) {
printk(KERN_INFO "onenand_wait: correctable ECC error = 0x%04x\n", ecc); printk(KERN_INFO "onenand_wait: correctable ECC error = 0x%04x\n", ecc);
mtd->ecc_stats.corrected++; mtd->ecc_stats.corrected++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment