Lines Matching defs:pos
18 * @pos: position pointing to the block we want to check
22 bool nanddev_isbad(struct nand_device *nand, const struct nand_pos *pos)
31 entry = nanddev_bbt_pos_to_entry(nand, pos);
35 if (nand->ops->isbad(nand, pos))
50 return nand->ops->isbad(nand, pos);
57 * @pos: position of the block to mark bad
64 int nanddev_markbad(struct nand_device *nand, const struct nand_pos *pos)
70 if (nanddev_isbad(nand, pos))
73 ret = nand->ops->markbad(nand, pos);
76 nanddev_pos_to_offs(nand, pos), ret);
81 entry = nanddev_bbt_pos_to_entry(nand, pos);
99 * @pos: NAND position to test
101 * Checks whether the eraseblock pointed by @pos is reserved or not.
105 bool nanddev_isreserved(struct nand_device *nand, const struct nand_pos *pos)
114 entry = nanddev_bbt_pos_to_entry(nand, pos);
123 * @pos: position of the block to erase
129 static int nanddev_erase(struct nand_device *nand, const struct nand_pos *pos)
131 if (nanddev_isbad(nand, pos) || nanddev_isreserved(nand, pos)) {
133 nanddev_pos_to_offs(nand, pos));
137 return nand->ops->erase(nand, pos);
158 struct nand_pos pos, last;
161 nanddev_offs_to_pos(nand, einfo->addr, &pos);
163 while (nanddev_pos_cmp(&pos, &last) <= 0) {
164 ret = nanddev_erase(nand, &pos);
166 einfo->fail_addr = nanddev_pos_to_offs(nand, &pos);
171 nanddev_pos_next_eraseblock(nand, &pos);
194 struct nand_pos pos, end;
200 nanddev_offs_to_pos(nand, offs, &pos);
203 for (nanddev_offs_to_pos(nand, offs, &pos);
204 nanddev_pos_cmp(&pos, &end) < 0;
205 nanddev_pos_next_lun(nand, &pos))