Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Artem Bityutskiy and committed by
David Woodhouse
bb4a0986 79186876

+4 -5
+4 -5
drivers/mtd/mtdoops.c
··· 169 169 cxt->nextpage = 0; 170 170 } 171 171 172 - while (mtd_can_have_bb(mtd)) { 172 + while (1) { 173 173 ret = mtd_block_isbad(mtd, cxt->nextpage * record_size); 174 174 if (!ret) 175 175 break; ··· 199 199 return; 200 200 } 201 201 202 - if (mtd_can_have_bb(mtd) && ret == -EIO) { 202 + if (ret == -EIO) { 203 203 ret = mtd_block_markbad(mtd, cxt->nextpage * record_size); 204 - if (ret < 0) { 204 + if (ret < 0 && ret != -EOPNOTSUPP) { 205 205 printk(KERN_ERR "mtdoops: block_markbad failed, aborting\n"); 206 206 return; 207 207 } ··· 257 257 size_t retlen; 258 258 259 259 for (page = 0; page < cxt->oops_pages; page++) { 260 - if (mtd_can_have_bb(mtd) && 261 - mtd_block_isbad(mtd, page * record_size)) 260 + if (mtd_block_isbad(mtd, page * record_size)) 262 261 continue; 263 262 /* Assume the page is used */ 264 263 mark_page_used(cxt, page);