/* onenand_block_isbad -  Check whether the block at the given offset is bad  */
static int onenand_block_isbad(struct mtd_info *mtd, loff_t ofs)
/* onenand_block_isbad -  Check whether the block at the given offset is bad  */
static int onenand_block_isbad(struct mtd_info *mtd, loff_t ofs)
{
	int ret;
	if (ofs > mtd->size)
		return -EINVAL;
	onenand_get_device(mtd, FL_READING);
	ret = onenand_block_isbad_nolock(mtd, ofs, 0);
	onenand_release_device(mtd);
	return ret;
}