From 327cf2922b4edf0439b219469722d2a502e37349 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Fri, 30 Dec 2011 16:35:35 +0200 Subject: mtd: do not use mtd->sync directly This patch teaches 'mtd_sync()' to do nothing when the MTD driver does not have the '->sync()' method, which allows us to remove all direct 'mtd->sync' accesses. Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- drivers/mtd/mtdswap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/mtd/mtdswap.c') diff --git a/drivers/mtd/mtdswap.c b/drivers/mtd/mtdswap.c index 4441c08b082..fe4426c1c73 100644 --- a/drivers/mtd/mtdswap.c +++ b/drivers/mtd/mtdswap.c @@ -1047,8 +1047,7 @@ static int mtdswap_flush(struct mtd_blktrans_dev *dev) { struct mtdswap_dev *d = MTDSWAP_MBD_TO_MTDSWAP(dev); - if (d->mtd->sync) - mtd_sync(d->mtd); + mtd_sync(d->mtd); return 0; } -- cgit v1.2.3