Browse Source

kernel: mtk_bmt: skip bitflip check if threshold isn't set

kernel spi-nand driver leaves this field empty and let mtd set it later.

Signed-off-by: Chuanhong Guo <[email protected]>
Chuanhong Guo 3 years ago
parent
commit
6fa50e26e7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      target/linux/generic/files/drivers/mtd/nand/mtk_bmt.c

+ 1 - 1
target/linux/generic/files/drivers/mtd/nand/mtk_bmt.c

@@ -146,7 +146,7 @@ mtk_bmt_read(struct mtd_info *mtd, loff_t from,
 			goto out;
 		}
 
-		if (cur_ret >= mtd->bitflip_threshold)
+		if (mtd->bitflip_threshold && cur_ret >= mtd->bitflip_threshold)
 			mtk_bmt_remap_block(block, cur_block, mtd->erasesize);
 
 		ops->retlen += cur_ops.retlen;