/* Check, if the block is bad. Either by reading the bad block table or calling of the scan function.  */
static int nand_block_checkbad(struct mtd_info *mtd, loff_t ofs, int allowbbt)
/* Check, if the block is bad. Either by reading the bad block table or calling of the scan function.  */
static int nand_block_checkbad(struct mtd_info *mtd, loff_t ofs, int allowbbt)
{
	struct nand_chip *chip = mtd_to_nand(mtd);
	if (!(chip->options & NAND_SKIP_BBTSCAN) &&
	    !(chip->options & NAND_BBT_SCANNED)) {
		chip->options |= NAND_BBT_SCANNED;
		chip->scan_bbt(mtd);
	}
	if (!chip->bbt)
		return chip->block_bad(mtd, ofs);
	return nand_isbad_bbt(mtd, ofs, allowbbt);
}