mtd: introduce mtd_can_have_bb helper
This patch introduces new 'mtd_can_have_bb()' helper function which checks whether the flash can have bad eraseblocks. Then it changes all the direct 'mtd->block_isbad' use cases with 'mtd_can_have_bb()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
这个提交包含在:
@@ -664,7 +664,7 @@ static int io_init(struct ubi_device *ubi)
|
||||
ubi->peb_count = mtd_div_by_eb(ubi->mtd->size, ubi->mtd);
|
||||
ubi->flash_size = ubi->mtd->size;
|
||||
|
||||
if (ubi->mtd->block_isbad && ubi->mtd->block_markbad)
|
||||
if (mtd_can_have_bb(ubi->mtd))
|
||||
ubi->bad_allowed = 1;
|
||||
|
||||
if (ubi->mtd->type == MTD_NORFLASH) {
|
||||
|
在新工单中引用
屏蔽一个用户