Lines Matching refs:mtd

44 static int erase_write (struct mtd_info *mtd, unsigned long pos,  in erase_write()  argument
57 ret = mtd_erase(mtd, &erase); in erase_write()
61 pos, len, mtd->name); in erase_write()
69 ret = mtd_write(mtd, pos, len, &retlen, buf); in erase_write()
80 struct mtd_info *mtd = mtdblk->mbd.mtd; in write_cached_data() local
87 "at 0x%lx, size 0x%x\n", mtd->name, in write_cached_data()
90 ret = erase_write (mtd, mtdblk->cache_offset, in write_cached_data()
113 struct mtd_info *mtd = mtdblk->mbd.mtd; in do_cached_write() local
119 mtd->name, pos, len); in do_cached_write()
122 return mtd_write(mtd, pos, len, &retlen, buf); in do_cached_write()
137 ret = erase_write (mtd, pos, size, buf); in do_cached_write()
154 ret = mtd_read(mtd, sect_start, sect_size, in do_cached_write()
183 struct mtd_info *mtd = mtdblk->mbd.mtd; in do_cached_read() local
189 mtd->name, pos, len); in do_cached_read()
192 ret = mtd_read(mtd, pos, len, &retlen, buf); in do_cached_read()
215 ret = mtd_read(mtd, pos, size, &retlen, buf); in do_cached_read()
242 mtdblk->cache_data = vmalloc(mtdblk->mbd.mtd->erasesize); in mtdblock_writesect()
264 if (mtd_type_is_nand(mbd->mtd)) in mtdblock_open()
266 mbd->tr->name, mbd->mtd->name); in mtdblock_open()
272 if (!(mbd->mtd->flags & MTD_NO_ERASE) && mbd->mtd->erasesize) { in mtdblock_open()
273 mtdblk->cache_size = mbd->mtd->erasesize; in mtdblock_open()
298 mtd_sync(mbd->mtd); in mtdblock_release()
313 mtd_sync(dev->mtd); in mtdblock_flush()
317 static void mtdblock_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) in mtdblock_add_mtd() argument
324 dev->mbd.mtd = mtd; in mtdblock_add_mtd()
325 dev->mbd.devnum = mtd->index; in mtdblock_add_mtd()
327 dev->mbd.size = mtd->size >> 9; in mtdblock_add_mtd()
330 if (!(mtd->flags & MTD_WRITEABLE)) in mtdblock_add_mtd()