mtd: mtdconcat: return -EOPNOTSUPP if block_markbad is undefined

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Mar 26 20:59:08 EDT 2012


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=79186876441278e7276d335448a4cb47fc4c1d8e
Commit:     79186876441278e7276d335448a4cb47fc4c1d8e
Parent:     c4cc625ea5958d065c21cc0fcea29e9ed8f3d2bc
Author:     Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
AuthorDate: Fri Feb 3 11:03:28 2012 +0200
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Tue Mar 27 00:23:43 2012 +0100

    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 at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at 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;
 



More information about the linux-mtd-cvs mailing list