mtd: do not use mtd->block_markbad directly
Instead, use the new 'mtd_can_have_bb()', or just rely on 'mtd_block_markbad()' return code, which will be -EOPNOTSUPP if bad blocks are not supported. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
committed by
David Woodhouse
parent
d58b27ed58
commit
800ffd3496
@@ -447,6 +447,8 @@ static inline int mtd_block_isbad(struct mtd_info *mtd, loff_t ofs)
|
||||
|
||||
static inline int mtd_block_markbad(struct mtd_info *mtd, loff_t ofs)
|
||||
{
|
||||
if (!mtd->block_markbad)
|
||||
return -EOPNOTSUPP;
|
||||
return mtd->block_markbad(mtd, ofs);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user