aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/onenand
diff options
context:
space:
mode:
authorAdrian Hunter <ext-adrian.hunter@nokia.com>2007-10-12 03:19:38 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2007-10-14 08:37:41 -0400
commit30a7eb298af849bae3050e0a3f4c130995da22b0 (patch)
tree1f12dd85a9d2fb835c25a173cd1e10c457f8492f /drivers/mtd/onenand
parent34627f0e768de6af95e3523c29a16cbb95ce3197 (diff)
[MTD] [OneNAND] Return only negative error codes
The OneNAND driver was confusing JFFS2 by returning positive error codes. Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/onenand')
-rw-r--r--drivers/mtd/onenand/onenand_base.c4
1 files changed, 2 insertions, 2 deletions
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)
327 printk(KERN_ERR "onenand_wait: controller error = 0x%04x\n", ctrl); 327 printk(KERN_ERR "onenand_wait: controller error = 0x%04x\n", ctrl);
328 if (ctrl & ONENAND_CTRL_LOCK) 328 if (ctrl & ONENAND_CTRL_LOCK)
329 printk(KERN_ERR "onenand_wait: it's locked error.\n"); 329 printk(KERN_ERR "onenand_wait: it's locked error.\n");
330 return ctrl; 330 return -EIO;
331 } 331 }
332 332
333 if (interrupt & ONENAND_INT_READ) { 333 if (interrupt & ONENAND_INT_READ) {
@@ -336,7 +336,7 @@ static int onenand_wait(struct mtd_info *mtd, int state)
336 if (ecc & ONENAND_ECC_2BIT_ALL) { 336 if (ecc & ONENAND_ECC_2BIT_ALL) {
337 printk(KERN_ERR "onenand_wait: ECC error = 0x%04x\n", ecc); 337 printk(KERN_ERR "onenand_wait: ECC error = 0x%04x\n", ecc);
338 mtd->ecc_stats.failed++; 338 mtd->ecc_stats.failed++;
339 return ecc; 339 return -EBADMSG;
340 } else if (ecc & ONENAND_ECC_1BIT_ALL) { 340 } else if (ecc & ONENAND_ECC_1BIT_ALL) {
341 printk(KERN_INFO "onenand_wait: correctable ECC error = 0x%04x\n", ecc); 341 printk(KERN_INFO "onenand_wait: correctable ECC error = 0x%04x\n", ecc);
342 mtd->ecc_stats.corrected++; 342 mtd->ecc_stats.corrected++;