]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mtd: nand: pxa3xx: read_page() returns max_bitflips
authorEzequiel Garcia <ezequiel.garcia@free-electrons.com>
Thu, 7 Nov 2013 15:17:13 +0000 (12:17 -0300)
committerBrian Norris <computersforpeace@gmail.com>
Fri, 22 Nov 2013 22:12:51 +0000 (14:12 -0800)
As per the ecc.read_page() prototype, we must return the maximum number
of bitflips that were corrected on any one region covering an ecc step.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/pxa3xx_nand.c

index 5f081880ff58eda7e34b2c7bf81bcd6ac74ae258..c0d77c9bc2a86e9551df49fef305ccf24f5b53a4 100644 (file)
@@ -751,6 +751,7 @@ static int pxa3xx_nand_read_page_hwecc(struct mtd_info *mtd,
 {
        struct pxa3xx_nand_host *host = mtd->priv;
        struct pxa3xx_nand_info *info = host->info_data;
+       int max_bitflips = 0;
 
        chip->read_buf(mtd, buf, mtd->writesize);
        chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
@@ -758,6 +759,7 @@ static int pxa3xx_nand_read_page_hwecc(struct mtd_info *mtd,
        if (info->retcode == ERR_SBERR) {
                switch (info->use_ecc) {
                case 1:
+                       max_bitflips = 1;
                        mtd->ecc_stats.corrected++;
                        break;
                case 0:
@@ -776,7 +778,7 @@ static int pxa3xx_nand_read_page_hwecc(struct mtd_info *mtd,
                        mtd->ecc_stats.failed++;
        }
 
-       return 0;
+       return max_bitflips;
 }
 
 static uint8_t pxa3xx_nand_read_byte(struct mtd_info *mtd)