Skip to content

Commit

Permalink
mtd: mtdconcat: return -EOPNOTSUPP if block_markbad is undefined
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Artem Bityutskiy authored and David Woodhouse committed Mar 26, 2012
1 parent c4cc625 commit 7918687
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions drivers/mtd/mtdconcat.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,9 +673,6 @@ static int concat_block_markbad(struct mtd_info *mtd, loff_t ofs)
struct mtd_concat *concat = CONCAT(mtd);
int i, err = -EINVAL;

if (!mtd_can_have_bb(concat->subdev[0]))
return 0;

if (ofs > mtd->size)
return -EINVAL;

Expand Down

0 comments on commit 7918687

Please sign in to comment.