[PATCH 1/4] mtd: mtdconcat: return -EOPNOTSUPP if block_markbad is undefined

Artem Bityutskiy dedekind1 at gmail.com
Fri Feb 3 04:44:04 EST 2012


From: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>

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 at linux.intel.com>
---
 drivers/mtd/mtdconcat.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c
index 5c7eb69..d826a8a 100644
--- a/drivers/mtd/mtdconcat.c
+++ b/drivers/mtd/mtdconcat.c
@@ -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;
 
-- 
1.7.9




More information about the linux-mtd mailing list