aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtdoops.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-02-03 04:23:57 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-03-26 19:23:53 -0400
commitbb4a09866faebe33bf842ecb864fef2ce042b01c (patch)
tree6c1f4ff0557b4edd9455bee4c2488c62b5d9c527 /drivers/mtd/mtdoops.c
parent79186876441278e7276d335448a4cb47fc4c1d8e (diff)
mtdoops: clean-up new MTD API usage
Let's remove useless 'mtd_can_have_bb()' function invocations. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/mtdoops.c')
-rw-r--r--drivers/mtd/mtdoops.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
index 3ce99e00a49e..ae36d7e1e913 100644
--- a/drivers/mtd/mtdoops.c
+++ b/drivers/mtd/mtdoops.c
@@ -169,7 +169,7 @@ static void mtdoops_workfunc_erase(struct work_struct *work)
169 cxt->nextpage = 0; 169 cxt->nextpage = 0;
170 } 170 }
171 171
172 while (mtd_can_have_bb(mtd)) { 172 while (1) {
173 ret = mtd_block_isbad(mtd, cxt->nextpage * record_size); 173 ret = mtd_block_isbad(mtd, cxt->nextpage * record_size);
174 if (!ret) 174 if (!ret)
175 break; 175 break;
@@ -199,9 +199,9 @@ badblock:
199 return; 199 return;
200 } 200 }
201 201
202 if (mtd_can_have_bb(mtd) && ret == -EIO) { 202 if (ret == -EIO) {
203 ret = mtd_block_markbad(mtd, cxt->nextpage * record_size); 203 ret = mtd_block_markbad(mtd, cxt->nextpage * record_size);
204 if (ret < 0) { 204 if (ret < 0 && ret != -EOPNOTSUPP) {
205 printk(KERN_ERR "mtdoops: block_markbad failed, aborting\n"); 205 printk(KERN_ERR "mtdoops: block_markbad failed, aborting\n");
206 return; 206 return;
207 } 207 }
@@ -257,8 +257,7 @@ static void find_next_position(struct mtdoops_context *cxt)
257 size_t retlen; 257 size_t retlen;
258 258
259 for (page = 0; page < cxt->oops_pages; page++) { 259 for (page = 0; page < cxt->oops_pages; page++) {
260 if (mtd_can_have_bb(mtd) && 260 if (mtd_block_isbad(mtd, page * record_size))
261 mtd_block_isbad(mtd, page * record_size))
262 continue; 261 continue;
263 /* Assume the page is used */ 262 /* Assume the page is used */
264 mark_page_used(cxt, page); 263 mark_page_used(cxt, page);