/* onenand_block_markbad -  Mark the block at the given offset as bad  */
static int onenand_block_markbad(struct mtd_info *mtd, loff_t ofs)
/* onenand_block_markbad -  Mark the block at the given offset as bad  */
static int onenand_block_markbad(struct mtd_info *mtd, loff_t ofs)
{
	struct onenand_chip *this = mtd->priv;
	int ret;
	ret = onenand_block_isbad(mtd, ofs);
	if (ret) {
		if (ret > 0)
			return 0;
		return ret;
	}
	onenand_get_device(mtd, FL_WRITING);
	ret = this->block_markbad(mtd, ofs);
	onenand_release_device(mtd);
	return ret;
}