mtd: atmel_nand: fix pmecc selction for ecc requirement typo

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Aug 5 16:59:06 EDT 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=edc9cba495680a8a4968ed204b5c9f61a991bf4f
Commit:     edc9cba495680a8a4968ed204b5c9f61a991bf4f
Parent:     68e8078072e802e77134664f11d2ffbfbd2f8fbe
Author:     Josh Wu <josh.wu at atmel.com>
AuthorDate: Wed Jul 3 17:56:19 2013 +0800
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Mon Aug 5 21:03:06 2013 +0100

    mtd: atmel_nand: fix pmecc selction for ecc requirement typo
    
    Atmel PMECC support 2, 4, 8, 12, 24 bit error correction.
    So if the ecc requirement in ONFI is <= 2, 4, 8, 12, 24.
    We will use 2, 4, 8, 12, 24.
    
    This patch fix the typo. Use '<=' replace '<'.
    
    Reported-by: Scott Wood <scottwood at freescale.com>
    Signed-off-by: Josh Wu <josh.wu at atmel.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/atmel_nand.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 73228e0..a43adce 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -959,11 +959,11 @@ static int pmecc_choose_ecc(struct atmel_nand_host *host,
 			host->pmecc_corr_cap = 2;
 		else if (*cap <= 4)
 			host->pmecc_corr_cap = 4;
-		else if (*cap < 8)
+		else if (*cap <= 8)
 			host->pmecc_corr_cap = 8;
-		else if (*cap < 12)
+		else if (*cap <= 12)
 			host->pmecc_corr_cap = 12;
-		else if (*cap < 24)
+		else if (*cap <= 24)
 			host->pmecc_corr_cap = 24;
 		else
 			return -EINVAL;



More information about the linux-mtd-cvs mailing list