aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtdchar.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-01-02 06:59:12 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-01-09 13:26:26 -0500
commit800ffd3496987e91f599a135060ef49731e045ac (patch)
treea62c4985597e6ce01d8f8ab07f67212357e2a846 /drivers/mtd/mtdchar.c
parentd58b27ed58a30faf376e40d19945f34301944b8d (diff)
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 <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/mtdchar.c')
-rw-r--r--drivers/mtd/mtdchar.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 64efcbf087e9..50c6a1e7f675 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -877,10 +877,7 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg)
877 877
878 if (copy_from_user(&offs, argp, sizeof(loff_t))) 878 if (copy_from_user(&offs, argp, sizeof(loff_t)))
879 return -EFAULT; 879 return -EFAULT;
880 if (!mtd->block_markbad) 880 return mtd_block_markbad(mtd, offs);
881 ret = -EOPNOTSUPP;
882 else
883 return mtd_block_markbad(mtd, offs);
884 break; 881 break;
885 } 882 }
886 883