-/*
- * Read oob data from flash
- */
-int nftl_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;
- ops.len = len;
-
- res = mtd->read_oob(mtd, offs & ~(mtd->writesize - 1), &ops);
- *retlen = ops.retlen;
- return res;
-}
-
-/*
- * Write oob data to flash
- */
-int nftl_write_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;
- ops.len = len;
-
- res = mtd->write_oob(mtd, offs & ~(mtd->writesize - 1), &ops);
- *retlen = ops.retlen;
- return res;
-}
-
-/*
- * Write data and oob to flash
- */
-static int nftl_write(struct mtd_info *mtd, loff_t offs, size_t len,
- size_t *retlen, uint8_t *buf, uint8_t *oob)
-{
- struct mtd_oob_ops ops;
- int res;
-
- ops.mode = MTD_OOB_PLACE;
- ops.ooboffs = offs;
- ops.ooblen = mtd->oobsize;
- ops.oobbuf = oob;
- ops.datbuf = buf;
- ops.len = len;
-
- res = mtd->write_oob(mtd, offs & ~(mtd->writesize - 1), &ops);
- *retlen = ops.retlen;
- return res;
-}
-