forked from luck/tmp_suning_uos_patched
mtd: mtdconcat: return -EOPNOTSUPP if block_markbad is undefined
The main 'mtd_block_markbad()' function returns -EOPNOTSUPP if the '->block_markbad' method is undefined, and mtdconcat should do the same. Fix this by simply removing the 'mtd_can_have_bb()' because it is not really necessary. It could be treated as an optimization, but this function is expected to be used so rarely that it does not matter. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
parent
c4cc625ea5
commit
7918687644
|
@ -673,9 +673,6 @@ static int concat_block_markbad(struct mtd_info *mtd, loff_t ofs)
|
||||||
struct mtd_concat *concat = CONCAT(mtd);
|
struct mtd_concat *concat = CONCAT(mtd);
|
||||||
int i, err = -EINVAL;
|
int i, err = -EINVAL;
|
||||||
|
|
||||||
if (!mtd_can_have_bb(concat->subdev[0]))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (ofs > mtd->size)
|
if (ofs > mtd->size)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user