Commit 85f2f2a809d658c15b574df02ede92090f45a1f2
Committed by
David Woodhouse
1 parent
b0a31f7b2a
Exists in
master
and in
20 other branches
mtd: introduce mtd_sync interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Showing 11 changed files with 17 additions and 14 deletions Side-by-side Diff
drivers/mtd/ftl.c
drivers/mtd/mtdblock.c
... | ... | @@ -323,7 +323,7 @@ |
323 | 323 | if (!--mtdblk->count) { |
324 | 324 | /* It was the last usage. Free the cache */ |
325 | 325 | if (mbd->mtd->sync) |
326 | - mbd->mtd->sync(mbd->mtd); | |
326 | + mtd_sync(mbd->mtd); | |
327 | 327 | vfree(mtdblk->cache_data); |
328 | 328 | } |
329 | 329 | |
... | ... | @@ -343,7 +343,7 @@ |
343 | 343 | mutex_unlock(&mtdblk->cache_mutex); |
344 | 344 | |
345 | 345 | if (dev->mtd->sync) |
346 | - dev->mtd->sync(dev->mtd); | |
346 | + mtd_sync(dev->mtd); | |
347 | 347 | return 0; |
348 | 348 | } |
349 | 349 |
drivers/mtd/mtdchar.c
drivers/mtd/mtdconcat.c
drivers/mtd/mtdpart.c
drivers/mtd/mtdswap.c
drivers/mtd/rfd_ftl.c
drivers/mtd/ubi/kapi.c
fs/jffs2/super.c
fs/logfs/dev_mtd.c
include/linux/mtd/mtd.h
... | ... | @@ -206,15 +206,13 @@ |
206 | 206 | size_t len); |
207 | 207 | int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, |
208 | 208 | unsigned long count, loff_t to, size_t *retlen); |
209 | + void (*sync) (struct mtd_info *mtd); | |
209 | 210 | |
210 | 211 | /* Backing device capabilities for this device |
211 | 212 | * - provides mmap capabilities |
212 | 213 | */ |
213 | 214 | struct backing_dev_info *backing_dev_info; |
214 | 215 | |
215 | - /* Sync */ | |
216 | - void (*sync) (struct mtd_info *mtd); | |
217 | - | |
218 | 216 | /* Chip-supported device locking */ |
219 | 217 | int (*lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); |
220 | 218 | int (*unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); |
... | ... | @@ -379,6 +377,11 @@ |
379 | 377 | unsigned long count, loff_t to, size_t *retlen) |
380 | 378 | { |
381 | 379 | return mtd->writev(mtd, vecs, count, to, retlen); |
380 | +} | |
381 | + | |
382 | +static inline void mtd_sync(struct mtd_info *mtd) | |
383 | +{ | |
384 | + mtd->sync(mtd); | |
382 | 385 | } |
383 | 386 | |
384 | 387 | static inline struct mtd_info *dev_to_mtd(struct device *dev) |