kernel: mtk_bmt: skip bitflip check if threshold isn't set
authorChuanhong Guo <gch981213@gmail.com>
Thu, 7 Apr 2022 01:56:02 +0000 (09:56 +0800)
committerChuanhong Guo <gch981213@gmail.com>
Sat, 9 Apr 2022 13:08:26 +0000 (21:08 +0800)
kernel spi-nand driver leaves this field empty and let mtd set it later.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
target/linux/generic/files/drivers/mtd/nand/mtk_bmt.c

index f1df4a11f12dad104a39f9c7b886a15584d14c02..bcff7d6ac8207644d667a6e35aca5a12dcfab828 100644 (file)
@@ -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;