mtd: rawnand: cafe: Set the NAND_NO_BBM_QUIRK flag
authorBoris Brezillon <boris.brezillon@collabora.com>
Mon, 11 May 2020 06:49:16 +0000 (08:49 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 11 May 2020 07:51:43 +0000 (09:51 +0200)
We have a dummy block_bad() implementation returning 0. Let's set the
NAND_NO_BBM_QUIRK flag and let the core take care of that.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200511064917.6255-2-boris.brezillon@collabora.com
drivers/mtd/nand/raw/cafe_nand.c

index 2d1c22d..2a0df13 100644 (file)
@@ -546,11 +546,6 @@ static int cafe_nand_write_page_lowlevel(struct nand_chip *chip,
        return nand_prog_page_end_op(chip);
 }
 
-static int cafe_nand_block_bad(struct nand_chip *chip, loff_t ofs)
-{
-       return 0;
-}
-
 /* F_2[X]/(X**6+X+1)  */
 static unsigned short gf64_mul(u8 a, u8 b)
 {
@@ -718,10 +713,8 @@ static int cafe_nand_probe(struct pci_dev *pdev,
        /* Enable the following for a flash based bad block table */
        cafe->nand.bbt_options = NAND_BBT_USE_FLASH;
 
-       if (skipbbt) {
-               cafe->nand.options |= NAND_SKIP_BBTSCAN;
-               cafe->nand.legacy.block_bad = cafe_nand_block_bad;
-       }
+       if (skipbbt)
+               cafe->nand.options |= NAND_SKIP_BBTSCAN | NAND_NO_BBM_QUIRK;
 
        if (numtimings && numtimings != 3) {
                dev_warn(&cafe->pdev->dev, "%d timing register values ignored; precisely three are required\n", numtimings);