]> git.sur5r.net Git - u-boot/commitdiff
mtd: nand: omap_gpmc: Fix update of read_ecc in oob
authorBelisko Marek <marek.belisko@gmail.com>
Fri, 25 Apr 2014 10:00:07 +0000 (12:00 +0200)
committerTom Rini <trini@ti.com>
Tue, 13 May 2014 23:48:17 +0000 (19:48 -0400)
We need to flip only one bit not assign.

Signed-off-by: Marek Belisko <marek.belisko@gmail.com>
Acked-by: Pekon Gupta <pekon@ti.com>
drivers/mtd/nand/omap_gpmc.c

index 881a63618c3205786fbc866b5b2b3d90af240024..bf99b8e6759c1b0c6ad2c126fc75c322c9364322 100644 (file)
@@ -403,7 +403,7 @@ static int omap_correct_data_bch(struct mtd_info *mtd, uint8_t *dat,
                        dat[byte_pos] ^= 1 << bit_pos;
                        printf("nand: bit-flip corrected @data=%d\n", byte_pos);
                } else if (byte_pos < error_max) {
-                       read_ecc[byte_pos - SECTOR_BYTES] = 1 << bit_pos;
+                       read_ecc[byte_pos - SECTOR_BYTES] ^= 1 << bit_pos;
                        printf("nand: bit-flip corrected @oob=%d\n", byte_pos -
                                                                SECTOR_BYTES);
                } else {