/* nand_markbad_bbt -  Mark a block bad in the BBT @mtd: MTD device structure @offs: offset of the bad block  */
int nand_markbad_bbt(struct mtd_info *mtd, loff_t offs)
/* nand_markbad_bbt -  Mark a block bad in the BBT @mtd: MTD device structure @offs: offset of the bad block  */
int nand_markbad_bbt(struct mtd_info *mtd, loff_t offs)
{
	struct nand_chip *this = mtd_to_nand(mtd);
	int block, ret = 0;
	block = (int)(offs >> this->bbt_erase_shift);
	bbt_mark_entry(this, block, BBT_BLOCK_WORN);
	if (this->bbt_options & NAND_BBT_USE_FLASH)
		ret = nand_update_bbt(mtd, offs);
	return ret;
}