From 800ffd3496987e91f599a135060ef49731e045ac Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Mon, 2 Jan 2012 13:59:12 +0200 Subject: 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 Signed-off-by: David Woodhouse --- drivers/mtd/mtdoops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/mtd/mtdoops.c') diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c index a4c8f67560e0..db8e8272d69b 100644 --- a/drivers/mtd/mtdoops.c +++ b/drivers/mtd/mtdoops.c @@ -199,7 +199,7 @@ badblock: return; } - if (mtd->block_markbad && ret == -EIO) { + if (mtd_can_have_bb(mtd) && ret == -EIO) { ret = mtd_block_markbad(mtd, cxt->nextpage * record_size); if (ret < 0) { printk(KERN_ERR "mtdoops: block_markbad failed, aborting\n"); -- cgit v1.2.1