/* nand_block_isbad -  Check if block at offset is bad @mtd: MTD device structure @offs: offset relative to mtd start  */
static int nand_block_isbad(struct mtd_info *mtd, loff_t offs)
/* nand_block_isbad -  Check if block at offset is bad @mtd: MTD device structure @offs: offset relative to mtd start  */
static int nand_block_isbad(struct mtd_info *mtd, loff_t offs)
{
	struct nand_chip *chip = mtd_to_nand(mtd);
	int chipnr = (int)(offs >> chip->chip_shift);
	int ret;
	nand_get_device(mtd, FL_READING);
	chip->select_chip(mtd, chipnr);
	ret = nand_block_checkbad(mtd, offs, 0);
	chip->select_chip(mtd, -1);
	nand_release_device(mtd);
	return ret;
}