/* Actual INFTL access routines. Read oob data from flash  */
int inftl_read_oob(struct mtd_info *mtd, loff_t offs, size_t len, size_t *retlen, uint8_t *buf)
/* Actual INFTL access routines. Read oob data from flash  */
int inftl_read_oob(struct mtd_info *mtd, loff_t offs, size_t len, size_t *retlen, uint8_t *buf)
{
	struct mtd_oob_ops ops;
	int res;
	ops.mode = MTD_OOB_PLACE;
	ops.ooboffs = offs & (mtd->writesize - 1);
	ops.ooblen = len;
	ops.oobbuf = buf;
	ops.datbuf = NULL;
	res = mtd->read_oob(mtd, offs & ~(mtd->writesize - 1), &ops);
	*retlen = ops.oobretlen;
	return res;
}