From c7052c256c1d028e433b9aa5efab35b5a6651eb6 Mon Sep 17 00:00:00 2001 From: Martin Ayotte Date: Fri, 11 Jan 2019 09:28:56 -0500 Subject: [PATCH] fix nand-disable-badblock --- ...disable-badblock-check-for-migration.patch | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/patch/kernel/sunxi-dev/nand-disable-badblock-check-for-migration.patch b/patch/kernel/sunxi-dev/nand-disable-badblock-check-for-migration.patch index d60d42d08..14de9b6b4 100644 --- a/patch/kernel/sunxi-dev/nand-disable-badblock-check-for-migration.patch +++ b/patch/kernel/sunxi-dev/nand-disable-badblock-check-for-migration.patch @@ -1,31 +1,30 @@ diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c -index 77533f7..8b3b184 100644 +index 71050a0..5f36704 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c -@@ -532,11 +532,7 @@ static int nand_block_checkbad(struct mtd_info *mtd, loff_t ofs, int allowbbt) - { +@@ -460,10 +460,7 @@ static int nand_block_checkbad(struct mtd_info *mtd, loff_t ofs, int allowbbt) struct nand_chip *chip = mtd_to_nand(mtd); -- if (!chip->bbt) -- return chip->block_bad(mtd, ofs); + /* Return info from the table */ +- if (chip->bbt) +- return nand_isbad_bbt(chip, ofs, allowbbt); - -- /* Return info from the table */ -- return nand_isbad_bbt(mtd, ofs, allowbbt); +- return nand_isbad_bbm(chip, ofs); + return 0; } /** -@@ -3030,16 +3026,7 @@ static int nand_block_isbad(struct mtd_info *mtd, loff_t offs) +@@ -4252,16 +4249,7 @@ static int nand_block_isbad(struct mtd_info *mtd, loff_t offs) int chipnr = (int)(offs >> chip->chip_shift); int ret; - /* Select the NAND device */ - nand_get_device(mtd, FL_READING); -- chip->select_chip(mtd, chipnr); +- chip->select_chip(chip, chipnr); - - ret = nand_block_checkbad(mtd, offs, 0); - -- chip->select_chip(mtd, -1); +- chip->select_chip(chip, -1); - nand_release_device(mtd); - - return ret;