|
@@ -343,7 +343,7 @@ static int mtdswap_read_markers(struct mtdswap_dev *d, struct swap_eb *eb)
|
|
offset = mtdswap_eb_offset(d, eb);
|
|
offset = mtdswap_eb_offset(d, eb);
|
|
|
|
|
|
/* Check first if the block is bad. */
|
|
/* Check first if the block is bad. */
|
|
- if (d->mtd->block_isbad && mtd_block_isbad(d->mtd, offset))
|
|
|
|
|
|
+ if (mtd_can_have_bb(d->mtd) && mtd_block_isbad(d->mtd, offset))
|
|
return MTDSWAP_SCANNED_BAD;
|
|
return MTDSWAP_SCANNED_BAD;
|
|
|
|
|
|
ops.ooblen = 2 * d->mtd->ecclayout->oobavail;
|
|
ops.ooblen = 2 * d->mtd->ecclayout->oobavail;
|
|
@@ -1058,7 +1058,7 @@ static unsigned int mtdswap_badblocks(struct mtd_info *mtd, uint64_t size)
|
|
|
|
|
|
badcnt = 0;
|
|
badcnt = 0;
|
|
|
|
|
|
- if (mtd->block_isbad)
|
|
|
|
|
|
+ if (mtd_can_have_bb(mtd))
|
|
for (offset = 0; offset < size; offset += mtd->erasesize)
|
|
for (offset = 0; offset < size; offset += mtd->erasesize)
|
|
if (mtd_block_isbad(mtd, offset))
|
|
if (mtd_block_isbad(mtd, offset))
|
|
badcnt++;
|
|
badcnt++;
|