Lines Matching refs:mtd
45 static struct mtd_info *mtd; variable
59 loff_t addr = (loff_t)ebnum * mtd->erasesize; in multiblock_erase()
62 ei.mtd = mtd; in multiblock_erase()
64 ei.len = mtd->erasesize * blocks; in multiblock_erase()
66 err = mtd_erase(mtd, &ei); in multiblock_erase()
84 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock()
86 return mtdtest_write(mtd, addr, mtd->erasesize, iobuf); in write_eraseblock()
92 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock_by_page()
96 err = mtdtest_write(mtd, addr, pgsize, buf); in write_eraseblock_by_page()
110 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock_by_2pages()
114 err = mtdtest_write(mtd, addr, sz, buf); in write_eraseblock_by_2pages()
121 err = mtdtest_write(mtd, addr, pgsize, buf); in write_eraseblock_by_2pages()
128 loff_t addr = (loff_t)ebnum * mtd->erasesize; in read_eraseblock()
130 return mtdtest_read(mtd, addr, mtd->erasesize, iobuf); in read_eraseblock()
136 loff_t addr = (loff_t)ebnum * mtd->erasesize; in read_eraseblock_by_page()
140 err = mtdtest_read(mtd, addr, pgsize, buf); in read_eraseblock_by_page()
154 loff_t addr = (loff_t)ebnum * mtd->erasesize; in read_eraseblock_by_2pages()
158 err = mtdtest_read(mtd, addr, sz, buf); in read_eraseblock_by_2pages()
165 err = mtdtest_read(mtd, addr, pgsize, buf); in read_eraseblock_by_2pages()
188 k = (uint64_t)goodebcnt * (mtd->erasesize / 1024) * 1000; in calc_speed()
213 mtd = get_mtd_device(NULL, dev); in mtd_speedtest_init()
214 if (IS_ERR(mtd)) { in mtd_speedtest_init()
215 err = PTR_ERR(mtd); in mtd_speedtest_init()
220 if (mtd->writesize == 1) { in mtd_speedtest_init()
225 pgsize = mtd->writesize; in mtd_speedtest_init()
227 tmp = mtd->size; in mtd_speedtest_init()
228 do_div(tmp, mtd->erasesize); in mtd_speedtest_init()
230 pgcnt = mtd->erasesize / pgsize; in mtd_speedtest_init()
235 (unsigned long long)mtd->size, mtd->erasesize, in mtd_speedtest_init()
236 pgsize, ebcnt, pgcnt, mtd->oobsize); in mtd_speedtest_init()
242 iobuf = kmalloc(mtd->erasesize, GFP_KERNEL); in mtd_speedtest_init()
246 prandom_bytes(iobuf, mtd->erasesize); in mtd_speedtest_init()
251 err = mtdtest_scan_for_bad_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_speedtest_init()
259 err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_speedtest_init()
299 err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_speedtest_init()
339 err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_speedtest_init()
382 err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_speedtest_init()
422 put_mtd_device(mtd); in mtd_speedtest_init()