Lines Matching refs:res
174 int res, ret = 0, i, j, act = 0; in read_bbt() local
198 res = mtd_read(mtd, from, len, &retlen, buf); in read_bbt()
199 if (res < 0) { in read_bbt()
200 if (mtd_is_eccerr(res)) { in read_bbt()
203 return res; in read_bbt()
204 } else if (mtd_is_bitflip(res)) { in read_bbt()
207 ret = res; in read_bbt()
210 return res; in read_bbt()
267 int res = 0, i; in read_abs_bbt() local
273 res = read_bbt(mtd, buf, td->pages[i], in read_abs_bbt()
276 if (res) in read_abs_bbt()
277 return res; in read_abs_bbt()
281 res = read_bbt(mtd, buf, td->pages[0], in read_abs_bbt()
283 if (res) in read_abs_bbt()
284 return res; in read_abs_bbt()
318 int res, ret = 0; in scan_read_oob() local
329 res = mtd_read_oob(mtd, offs, &ops); in scan_read_oob()
330 if (res) { in scan_read_oob()
331 if (!mtd_is_bitflip_or_eccerr(res)) in scan_read_oob()
332 return res; in scan_read_oob()
333 else if (mtd_is_eccerr(res) || !ret) in scan_read_oob()
334 ret = res; in scan_read_oob()
623 int i, res, chip = 0; in write_bbt() local
722 res = mtd_read(mtd, to, len, &retlen, buf); in write_bbt()
723 if (res < 0) { in write_bbt()
726 return res; in write_bbt()
733 res = mtd_read_oob(mtd, to + mtd->writesize, &ops); in write_bbt()
734 if (res < 0 || ops.oobretlen != ops.ooblen) in write_bbt()
789 res = nand_erase_nand(mtd, &einfo, 1); in write_bbt()
790 if (res < 0) in write_bbt()
793 res = scan_write_bbt(mtd, to, len, buf, in write_bbt()
796 if (res < 0) in write_bbt()
808 pr_warn("nand_bbt: error while writing bad block table %d\n", res); in write_bbt()
809 return res; in write_bbt()
840 int i, chips, writeops, create, chipsel, res, res2; in check_create() local
857 res = res2 = 0; in check_create()
907 res = read_abs_bbt(mtd, buf, rd, chipsel); in check_create()
908 if (mtd_is_eccerr(res)) { in check_create()
929 if (mtd_is_bitflip(res) || mtd_is_bitflip(res2)) in check_create()
940 res = write_bbt(mtd, buf, td, md, chipsel); in check_create()
941 if (res < 0) in check_create()
942 return res; in check_create()
947 res = write_bbt(mtd, buf, md, td, chipsel); in check_create()
948 if (res < 0) in check_create()
949 return res; in check_create()
1078 int len, res; in nand_scan_bbt() local
1097 if ((res = nand_memory_bbt(mtd, bd))) { in nand_scan_bbt()
1111 res = -ENOMEM; in nand_scan_bbt()
1123 res = check_create(mtd, buf, bd); in nand_scan_bbt()
1124 if (res) in nand_scan_bbt()
1138 return res; in nand_scan_bbt()
1151 int len, res = 0; in nand_update_bbt() local
1182 res = write_bbt(mtd, buf, td, md, chipsel); in nand_update_bbt()
1183 if (res < 0) in nand_update_bbt()
1188 res = write_bbt(mtd, buf, md, td, chipsel); in nand_update_bbt()
1193 return res; in nand_update_bbt()
1336 int block, res; in nand_isbad_bbt() local
1339 res = bbt_get_entry(this, block); in nand_isbad_bbt()
1342 (unsigned int)offs, block, res); in nand_isbad_bbt()
1344 switch (res) { in nand_isbad_bbt()