aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/patches-4.4/0103-nand_fixes.patch
blob: 5e18fb4760173686f6ec33b40bcf70d67cae1716 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- a/drivers/mtd/nand/mtk_nand.c
+++ b/drivers/mtd/nand/mtk_nand.c
@@ -1017,8 +1017,8 @@
 	if (section >= eccsteps)
 		return -ERANGE;
 
-	oob_region->length = fdm->reg_size - fdm->ecc_size;
-	oob_region->offset = section * fdm->reg_size + fdm->ecc_size;
+	oob_region->length = fdm->reg_size - 1;
+	oob_region->offset = section * fdm->reg_size + 1;
 
 	return 0;
 }
@@ -1058,7 +1058,7 @@
 		fdm->reg_size = NFI_FDM_MAX_SIZE;
 
 	/* bad block mark storage */
-	fdm->ecc_size = 1;
+	fdm->ecc_size = fdm->reg_size;
 }
 
 static void mtk_nfc_set_bad_mark_ctl(struct mtk_nfc_bad_mark_ctl *bm_ctl,