From: Chuanhong Guo Date: Thu, 7 Apr 2022 01:56:02 +0000 (+0800) Subject: kernel: mtk_bmt: skip bitflip check if threshold isn't set X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=6fa50e26e7c1221085d8e71cde7e9148c540c752;p=openwrt%2Fstaging%2Fnbd.git 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 --- diff --git a/target/linux/generic/files/drivers/mtd/nand/mtk_bmt.c b/target/linux/generic/files/drivers/mtd/nand/mtk_bmt.c index f1df4a11f1..bcff7d6ac8 100644 --- a/target/linux/generic/files/drivers/mtd/nand/mtk_bmt.c +++ b/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;