|
@@ -1858,8 +1858,14 @@ static int sunxi_nand_hw_common_ecc_ctrl_init(struct mtd_info *mtd,
|
|
|
|
|
|
/* Add ECC info retrieval from DT */
|
|
/* Add ECC info retrieval from DT */
|
|
for (i = 0; i < ARRAY_SIZE(strengths); i++) {
|
|
for (i = 0; i < ARRAY_SIZE(strengths); i++) {
|
|
- if (ecc->strength <= strengths[i])
|
|
|
|
|
|
+ if (ecc->strength <= strengths[i]) {
|
|
|
|
+ /*
|
|
|
|
+ * Update ecc->strength value with the actual strength
|
|
|
|
+ * that will be used by the ECC engine.
|
|
|
|
+ */
|
|
|
|
+ ecc->strength = strengths[i];
|
|
break;
|
|
break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
if (i >= ARRAY_SIZE(strengths)) {
|
|
if (i >= ARRAY_SIZE(strengths)) {
|