Lines Matching refs:mtd
40 static struct mtd_info *mtd; variable
107 loff_t addr = ebnum * mtd->erasesize; in erase_eraseblock()
110 ei.mtd = mtd; in erase_eraseblock()
112 ei.len = mtd->erasesize; in erase_eraseblock()
114 err = mtd->erase(mtd, &ei); in erase_eraseblock()
131 loff_t addr = ebnum * mtd->erasesize; in is_block_bad()
134 ret = mtd->block_isbad(mtd, addr); in is_block_bad()
149 if (offs >= mtd->erasesize) in do_read()
150 offs -= mtd->erasesize; in do_read()
151 if (offs + len > mtd->erasesize) in do_read()
152 len = mtd->erasesize - offs; in do_read()
154 addr = eb * mtd->erasesize + offs; in do_read()
155 err = mtd->read(mtd, addr, len, &read, readbuf); in do_read()
175 if (offs >= mtd->erasesize) { in do_write()
183 if (offs + len > mtd->erasesize) { in do_write()
185 len = mtd->erasesize - offs; in do_write()
193 addr = eb * mtd->erasesize + offs; in do_write()
194 err = mtd->write(mtd, addr, len, &written, writebuf); in do_write()
203 while (offs > mtd->erasesize) { in do_write()
204 offsets[eb++] = mtd->erasesize; in do_write()
205 offs -= mtd->erasesize; in do_write()
251 mtd = get_mtd_device(NULL, dev); in mtd_stresstest_init()
252 if (IS_ERR(mtd)) { in mtd_stresstest_init()
253 err = PTR_ERR(mtd); in mtd_stresstest_init()
258 if (mtd->writesize == 1) { in mtd_stresstest_init()
263 pgsize = mtd->writesize; in mtd_stresstest_init()
265 tmp = mtd->size; in mtd_stresstest_init()
266 do_div(tmp, mtd->erasesize); in mtd_stresstest_init()
268 pgcnt = mtd->erasesize / mtd->writesize; in mtd_stresstest_init()
273 (unsigned long long)mtd->size, mtd->erasesize, in mtd_stresstest_init()
274 pgsize, ebcnt, pgcnt, mtd->oobsize); in mtd_stresstest_init()
277 bufsize = mtd->erasesize * 2; in mtd_stresstest_init()
288 offsets[i] = mtd->erasesize; in mtd_stresstest_init()
314 put_mtd_device(mtd); in mtd_stresstest_init()