• Home
  • Raw
  • Download

Lines Matching refs:mtd

35 static struct mtd_info *mtd;  variable
69 loff_t addr = ebnum * mtd->erasesize; in erase_eraseblock()
72 ei.mtd = mtd; in erase_eraseblock()
74 ei.len = mtd->erasesize; in erase_eraseblock()
76 err = mtd->erase(mtd, &ei); in erase_eraseblock()
111 loff_t addr = ebnum * mtd->erasesize; in write_eraseblock()
113 err = mtd->write(mtd, addr, mtd->erasesize, &written, iobuf); in write_eraseblock()
114 if (err || written != mtd->erasesize) { in write_eraseblock()
127 loff_t addr = ebnum * mtd->erasesize; in write_eraseblock_by_page()
131 err = mtd->write(mtd, addr, pgsize, &written, buf); in write_eraseblock_by_page()
150 loff_t addr = ebnum * mtd->erasesize; in write_eraseblock_by_2pages()
154 err = mtd->write(mtd, addr, sz, &written, buf); in write_eraseblock_by_2pages()
166 err = mtd->write(mtd, addr, pgsize, &written, buf); in write_eraseblock_by_2pages()
182 loff_t addr = ebnum * mtd->erasesize; in read_eraseblock()
184 err = mtd->read(mtd, addr, mtd->erasesize, &read, iobuf); in read_eraseblock()
188 if (err || read != mtd->erasesize) { in read_eraseblock()
201 loff_t addr = ebnum * mtd->erasesize; in read_eraseblock_by_page()
205 err = mtd->read(mtd, addr, pgsize, &read, buf); in read_eraseblock_by_page()
227 loff_t addr = ebnum * mtd->erasesize; in read_eraseblock_by_2pages()
231 err = mtd->read(mtd, addr, sz, &read, buf); in read_eraseblock_by_2pages()
246 err = mtd->read(mtd, addr, pgsize, &read, buf); in read_eraseblock_by_2pages()
263 loff_t addr = ebnum * mtd->erasesize; in is_block_bad()
266 ret = mtd->block_isbad(mtd, addr); in is_block_bad()
288 k = goodebcnt * mtd->erasesize / 1024; in calc_speed()
326 mtd = get_mtd_device(NULL, dev); in mtd_speedtest_init()
327 if (IS_ERR(mtd)) { in mtd_speedtest_init()
328 err = PTR_ERR(mtd); in mtd_speedtest_init()
333 if (mtd->writesize == 1) { in mtd_speedtest_init()
338 pgsize = mtd->writesize; in mtd_speedtest_init()
340 tmp = mtd->size; in mtd_speedtest_init()
341 do_div(tmp, mtd->erasesize); in mtd_speedtest_init()
343 pgcnt = mtd->erasesize / mtd->writesize; in mtd_speedtest_init()
348 (unsigned long long)mtd->size, mtd->erasesize, in mtd_speedtest_init()
349 pgsize, ebcnt, pgcnt, mtd->oobsize); in mtd_speedtest_init()
352 iobuf = kmalloc(mtd->erasesize, GFP_KERNEL); in mtd_speedtest_init()
359 set_random_data(iobuf, mtd->erasesize); in mtd_speedtest_init()
486 put_mtd_device(mtd); in mtd_speedtest_init()