Lines Matching refs:mtd

67 static struct mtd_info *mtd;   /* MTD device */  variable
95 return mtdtest_write(mtd, offset, mtd->writesize, wbuffer); in write_page()
108 ops.len = mtd->writesize; in rewrite_page()
116 err = mtd_write_oob(mtd, offset, &ops); in rewrite_page()
117 if (err || ops.retlen != mtd->writesize) { in rewrite_page()
138 memcpy(&oldstats, &mtd->ecc_stats, sizeof(oldstats)); in read_page()
140 err = mtd_read(mtd, offset, mtd->writesize, &read, rbuffer); in read_page()
142 err = mtd->ecc_stats.corrected - oldstats.corrected; in read_page()
144 if (err < 0 || read != mtd->writesize) { in read_page()
161 for (i = 0; i < mtd->writesize; i++) { in verify_page()
184 while (byte < mtd->writesize) { in insert_biterror()
208 for (i = 0; i < mtd->writesize; i++) in incremental_errors_test()
271 for (i = 0; i < mtd->writesize; i++) in overwrite_test()
336 mtd = get_mtd_device(NULL, dev); in mtd_nandbiterrs_init()
337 if (IS_ERR(mtd)) { in mtd_nandbiterrs_init()
338 err = PTR_ERR(mtd); in mtd_nandbiterrs_init()
343 if (!mtd_type_is_nand(mtd)) { in mtd_nandbiterrs_init()
350 (unsigned long long)mtd->size, mtd->erasesize, in mtd_nandbiterrs_init()
351 mtd->writesize, mtd->oobsize); in mtd_nandbiterrs_init()
353 subsize = mtd->writesize >> mtd->subpage_sft; in mtd_nandbiterrs_init()
354 subcount = mtd->writesize / subsize; in mtd_nandbiterrs_init()
358 offset = (loff_t)page_offset * mtd->writesize; in mtd_nandbiterrs_init()
359 eraseblock = mtd_div_by_eb(offset, mtd); in mtd_nandbiterrs_init()
364 wbuffer = kmalloc(mtd->writesize, GFP_KERNEL); in mtd_nandbiterrs_init()
370 rbuffer = kmalloc(mtd->writesize, GFP_KERNEL); in mtd_nandbiterrs_init()
376 err = mtdtest_erase_eraseblock(mtd, eraseblock); in mtd_nandbiterrs_init()
389 err = mtdtest_erase_eraseblock(mtd, eraseblock); in mtd_nandbiterrs_init()
404 put_mtd_device(mtd); in mtd_nandbiterrs_init()