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 <gch981213@gmail.com>
(cherry-picked from commit 6fa50e26e7c1221085d8e71cde7e9148c540c752)
This commit is contained in:
Chuanhong Guo 2022-04-07 09:56:02 +08:00 committed by Felix Fietkau
parent 42c8610efc
commit 329b1543f3

@ -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;