Lines Matching refs:mtd
26 static struct mtd_info *mtd; variable
47 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock()
50 err = mtd_write(mtd, addr, subpgsize, &written, writebuf); in write_eraseblock()
64 err = mtd_write(mtd, addr, subpgsize, &written, writebuf); in write_eraseblock()
82 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock2()
85 if (addr + (subpgsize * k) > (loff_t)(ebnum + 1) * mtd->erasesize) in write_eraseblock2()
88 err = mtd_write(mtd, addr, subpgsize * k, &written, writebuf); in write_eraseblock2()
121 loff_t addr = (loff_t)ebnum * mtd->erasesize; in verify_eraseblock()
125 err = mtd_read(mtd, addr, subpgsize, &read, readbuf); in verify_eraseblock()
152 err = mtd_read(mtd, addr, subpgsize, &read, readbuf); in verify_eraseblock()
182 loff_t addr = (loff_t)ebnum * mtd->erasesize; in verify_eraseblock2()
185 if (addr + (subpgsize * k) > (loff_t)(ebnum + 1) * mtd->erasesize) in verify_eraseblock2()
189 err = mtd_read(mtd, addr, subpgsize * k, &read, readbuf); in verify_eraseblock2()
217 loff_t addr = (loff_t)ebnum * mtd->erasesize; in verify_eraseblock_ff()
220 for (j = 0; j < mtd->erasesize / subpgsize; ++j) { in verify_eraseblock_ff()
222 err = mtd_read(mtd, addr, subpgsize, &read, readbuf); in verify_eraseblock_ff()
285 mtd = get_mtd_device(NULL, dev); in mtd_subpagetest_init()
286 if (IS_ERR(mtd)) { in mtd_subpagetest_init()
287 err = PTR_ERR(mtd); in mtd_subpagetest_init()
292 if (!mtd_type_is_nand(mtd)) { in mtd_subpagetest_init()
297 subpgsize = mtd->writesize >> mtd->subpage_sft; in mtd_subpagetest_init()
298 tmp = mtd->size; in mtd_subpagetest_init()
299 do_div(tmp, mtd->erasesize); in mtd_subpagetest_init()
301 pgcnt = mtd->erasesize / mtd->writesize; in mtd_subpagetest_init()
306 (unsigned long long)mtd->size, mtd->erasesize, in mtd_subpagetest_init()
307 mtd->writesize, subpgsize, ebcnt, pgcnt, mtd->oobsize); in mtd_subpagetest_init()
321 err = mtdtest_scan_for_bad_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_subpagetest_init()
325 err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_subpagetest_init()
363 err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_subpagetest_init()
407 err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_subpagetest_init()
421 put_mtd_device(mtd); in mtd_subpagetest_init()