Lines Matching refs:err
46 int err = 0; in write_eraseblock() local
50 err = mtd_write(mtd, addr, subpgsize, &written, writebuf); in write_eraseblock()
51 if (unlikely(err || written != subpgsize)) { in write_eraseblock()
58 return err ? err : -1; in write_eraseblock()
64 err = mtd_write(mtd, addr, subpgsize, &written, writebuf); in write_eraseblock()
65 if (unlikely(err || written != subpgsize)) { in write_eraseblock()
72 return err ? err : -1; in write_eraseblock()
75 return err; in write_eraseblock()
81 int err = 0, k; in write_eraseblock2() local
88 err = mtd_write(mtd, addr, subpgsize * k, &written, writebuf); in write_eraseblock2()
89 if (unlikely(err || written != subpgsize * k)) { in write_eraseblock2()
98 return err ? err : -1; in write_eraseblock2()
103 return err; in write_eraseblock2()
120 int err = 0; in verify_eraseblock() local
125 err = mtd_read(mtd, addr, subpgsize, &read, readbuf); in verify_eraseblock()
126 if (unlikely(err || read != subpgsize)) { in verify_eraseblock()
127 if (mtd_is_bitflip(err) && read == subpgsize) { in verify_eraseblock()
130 err = 0; in verify_eraseblock()
134 return err ? err : -1; in verify_eraseblock()
152 err = mtd_read(mtd, addr, subpgsize, &read, readbuf); in verify_eraseblock()
153 if (unlikely(err || read != subpgsize)) { in verify_eraseblock()
154 if (mtd_is_bitflip(err) && read == subpgsize) { in verify_eraseblock()
157 err = 0; in verify_eraseblock()
161 return err ? err : -1; in verify_eraseblock()
175 return err; in verify_eraseblock()
181 int err = 0, k; in verify_eraseblock2() local
189 err = mtd_read(mtd, addr, subpgsize * k, &read, readbuf); in verify_eraseblock2()
190 if (unlikely(err || read != subpgsize * k)) { in verify_eraseblock2()
191 if (mtd_is_bitflip(err) && read == subpgsize * k) { in verify_eraseblock2()
194 err = 0; in verify_eraseblock2()
198 return err ? err : -1; in verify_eraseblock2()
209 return err; in verify_eraseblock2()
216 int err = 0; in verify_eraseblock_ff() local
222 err = mtd_read(mtd, addr, subpgsize, &read, readbuf); in verify_eraseblock_ff()
223 if (unlikely(err || read != subpgsize)) { in verify_eraseblock_ff()
224 if (mtd_is_bitflip(err) && read == subpgsize) { in verify_eraseblock_ff()
227 err = 0; in verify_eraseblock_ff()
231 return err ? err : -1; in verify_eraseblock_ff()
242 return err; in verify_eraseblock_ff()
247 int err; in verify_all_eraseblocks_ff() local
254 err = verify_eraseblock_ff(i); in verify_all_eraseblocks_ff()
255 if (err) in verify_all_eraseblocks_ff()
256 return err; in verify_all_eraseblocks_ff()
260 err = mtdtest_relax(); in verify_all_eraseblocks_ff()
261 if (err) in verify_all_eraseblocks_ff()
262 return err; in verify_all_eraseblocks_ff()
270 int err = 0; in mtd_subpagetest_init() local
287 err = PTR_ERR(mtd); in mtd_subpagetest_init()
289 return err; in mtd_subpagetest_init()
309 err = -ENOMEM; in mtd_subpagetest_init()
321 err = mtdtest_scan_for_bad_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_subpagetest_init()
322 if (err) in mtd_subpagetest_init()
325 err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_subpagetest_init()
326 if (err) in mtd_subpagetest_init()
334 err = write_eraseblock(i); in mtd_subpagetest_init()
335 if (unlikely(err)) in mtd_subpagetest_init()
340 err = mtdtest_relax(); in mtd_subpagetest_init()
341 if (err) in mtd_subpagetest_init()
351 err = verify_eraseblock(i); in mtd_subpagetest_init()
352 if (unlikely(err)) in mtd_subpagetest_init()
357 err = mtdtest_relax(); in mtd_subpagetest_init()
358 if (err) in mtd_subpagetest_init()
363 err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_subpagetest_init()
364 if (err) in mtd_subpagetest_init()
367 err = verify_all_eraseblocks_ff(); in mtd_subpagetest_init()
368 if (err) in mtd_subpagetest_init()
377 err = write_eraseblock2(i); in mtd_subpagetest_init()
378 if (unlikely(err)) in mtd_subpagetest_init()
383 err = mtdtest_relax(); in mtd_subpagetest_init()
384 if (err) in mtd_subpagetest_init()
395 err = verify_eraseblock2(i); in mtd_subpagetest_init()
396 if (unlikely(err)) in mtd_subpagetest_init()
401 err = mtdtest_relax(); in mtd_subpagetest_init()
402 if (err) in mtd_subpagetest_init()
407 err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_subpagetest_init()
408 if (err) in mtd_subpagetest_init()
411 err = verify_all_eraseblocks_ff(); in mtd_subpagetest_init()
412 if (err) in mtd_subpagetest_init()
422 if (err) in mtd_subpagetest_init()
423 pr_info("error %d occurred\n", err); in mtd_subpagetest_init()
425 return err; in mtd_subpagetest_init()