fix nand-disable-badblock

This commit is contained in:
Martin Ayotte 2019-01-11 09:28:56 -05:00
parent eb492a7be6
commit c7052c256c

View file

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