Commit 327cf2922b4edf0439b219469722d2a502e37349
Committed by
David Woodhouse
1 parent
1dbebd3256
Exists in
master
and in
6 other branches
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 <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Showing 9 changed files with 11 additions and 21 deletions Side-by-side Diff
drivers/mtd/ftl.c
drivers/mtd/mtdblock.c
... | ... | @@ -322,8 +322,7 @@ |
322 | 322 | |
323 | 323 | if (!--mtdblk->count) { |
324 | 324 | /* It was the last usage. Free the cache */ |
325 | - if (mbd->mtd->sync) | |
326 | - mtd_sync(mbd->mtd); | |
325 | + mtd_sync(mbd->mtd); | |
327 | 326 | vfree(mtdblk->cache_data); |
328 | 327 | } |
329 | 328 | |
... | ... | @@ -341,9 +340,7 @@ |
341 | 340 | mutex_lock(&mtdblk->cache_mutex); |
342 | 341 | write_cached_data(mtdblk); |
343 | 342 | mutex_unlock(&mtdblk->cache_mutex); |
344 | - | |
345 | - if (dev->mtd->sync) | |
346 | - mtd_sync(dev->mtd); | |
343 | + mtd_sync(dev->mtd); | |
347 | 344 | return 0; |
348 | 345 | } |
349 | 346 |
drivers/mtd/mtdchar.c
drivers/mtd/mtdswap.c
drivers/mtd/rfd_ftl.c
drivers/mtd/ubi/kapi.c
fs/jffs2/super.c
fs/logfs/dev_mtd.c