From 381345652fca688aeaa967c231e5075cf68d05b6 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Fri, 30 Dec 2011 17:00:35 +0200 Subject: mtd: do not use mtd->lock, unlock and is_locked directly Instead, call the corresponding MTD API function which will return '-EOPNOTSUPP' if the operation is not supported. Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- drivers/mtd/mtdconcat.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'drivers/mtd/mtdconcat.c') diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c index 9119f76f87ff..aaafb5e18765 100644 --- a/drivers/mtd/mtdconcat.c +++ b/drivers/mtd/mtdconcat.c @@ -555,12 +555,9 @@ static int concat_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len) else size = len; - if (subdev->lock) { - err = mtd_lock(subdev, ofs, size); - if (err) - break; - } else - err = -EOPNOTSUPP; + err = mtd_lock(subdev, ofs, size); + if (err) + break; len -= size; if (len == 0) @@ -595,12 +592,9 @@ static int concat_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) else size = len; - if (subdev->unlock) { - err = mtd_unlock(subdev, ofs, size); - if (err) - break; - } else - err = -EOPNOTSUPP; + err = mtd_unlock(subdev, ofs, size); + if (err) + break; len -= size; if (len == 0) -- cgit v1.2.3