aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mtd/ftl.c3
-rw-r--r--drivers/mtd/mtdblock.c7
-rw-r--r--drivers/mtd/mtdchar.c2
-rw-r--r--drivers/mtd/mtdswap.c3
-rw-r--r--drivers/mtd/rfd_ftl.c3
-rw-r--r--drivers/mtd/ubi/kapi.c4
-rw-r--r--fs/jffs2/super.c4
-rw-r--r--fs/logfs/dev_mtd.c3
-rw-r--r--include/linux/mtd/mtd.h3
9 files changed, 11 insertions, 21 deletions
diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c
index c9c90299c9e2..19d637266fcd 100644
--- a/drivers/mtd/ftl.c
+++ b/drivers/mtd/ftl.c
@@ -650,8 +650,7 @@ static int reclaim_block(partition_t *part)
650 if (queued) { 650 if (queued) {
651 pr_debug("ftl_cs: waiting for transfer " 651 pr_debug("ftl_cs: waiting for transfer "
652 "unit to be prepared...\n"); 652 "unit to be prepared...\n");
653 if (part->mbd.mtd->sync) 653 mtd_sync(part->mbd.mtd);
654 mtd_sync(part->mbd.mtd);
655 } else { 654 } else {
656 static int ne = 0; 655 static int ne = 0;
657 if (++ne < 5) 656 if (++ne < 5)
diff --git a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c
index 496e1a6e8029..af6591237b9b 100644
--- a/drivers/mtd/mtdblock.c
+++ b/drivers/mtd/mtdblock.c
@@ -322,8 +322,7 @@ static int mtdblock_release(struct mtd_blktrans_dev *mbd)
322 322
323 if (!--mtdblk->count) { 323 if (!--mtdblk->count) {
324 /* It was the last usage. Free the cache */ 324 /* It was the last usage. Free the cache */
325 if (mbd->mtd->sync) 325 mtd_sync(mbd->mtd);
326 mtd_sync(mbd->mtd);
327 vfree(mtdblk->cache_data); 326 vfree(mtdblk->cache_data);
328 } 327 }
329 328
@@ -341,9 +340,7 @@ static int mtdblock_flush(struct mtd_blktrans_dev *dev)
341 mutex_lock(&mtdblk->cache_mutex); 340 mutex_lock(&mtdblk->cache_mutex);
342 write_cached_data(mtdblk); 341 write_cached_data(mtdblk);
343 mutex_unlock(&mtdblk->cache_mutex); 342 mutex_unlock(&mtdblk->cache_mutex);
344 343 mtd_sync(dev->mtd);
345 if (dev->mtd->sync)
346 mtd_sync(dev->mtd);
347 return 0; 344 return 0;
348} 345}
349 346
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 2020a169ed9c..23a51104aeb5 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -154,7 +154,7 @@ static int mtdchar_close(struct inode *inode, struct file *file)
154 pr_debug("MTD_close\n"); 154 pr_debug("MTD_close\n");
155 155
156 /* Only sync if opened RW */ 156 /* Only sync if opened RW */
157 if ((file->f_mode & FMODE_WRITE) && mtd->sync) 157 if ((file->f_mode & FMODE_WRITE))
158 mtd_sync(mtd); 158 mtd_sync(mtd);
159 159
160 iput(mfi->ino); 160 iput(mfi->ino);
diff --git a/drivers/mtd/mtdswap.c b/drivers/mtd/mtdswap.c
index 4441c08b082d..fe4426c1c736 100644
--- a/drivers/mtd/mtdswap.c
+++ b/drivers/mtd/mtdswap.c
@@ -1047,8 +1047,7 @@ static int mtdswap_flush(struct mtd_blktrans_dev *dev)
1047{ 1047{
1048 struct mtdswap_dev *d = MTDSWAP_MBD_TO_MTDSWAP(dev); 1048 struct mtdswap_dev *d = MTDSWAP_MBD_TO_MTDSWAP(dev);
1049 1049
1050 if (d->mtd->sync) 1050 mtd_sync(d->mtd);
1051 mtd_sync(d->mtd);
1052 return 0; 1051 return 0;
1053} 1052}
1054 1053
diff --git a/drivers/mtd/rfd_ftl.c b/drivers/mtd/rfd_ftl.c
index 5426d42cdea7..233b946e5d66 100644
--- a/drivers/mtd/rfd_ftl.c
+++ b/drivers/mtd/rfd_ftl.c
@@ -448,8 +448,7 @@ static int reclaim_block(struct partition *part, u_long *old_sector)
448 int rc; 448 int rc;
449 449
450 /* we have a race if sync doesn't exist */ 450 /* we have a race if sync doesn't exist */
451 if (part->mbd.mtd->sync) 451 mtd_sync(part->mbd.mtd);
452 mtd_sync(part->mbd.mtd);
453 452
454 score = 0x7fffffff; /* MAX_INT */ 453 score = 0x7fffffff; /* MAX_INT */
455 best_block = -1; 454 best_block = -1;
diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c
index 9f265cc1a0d3..9fdb35367fe0 100644
--- a/drivers/mtd/ubi/kapi.c
+++ b/drivers/mtd/ubi/kapi.c
@@ -714,9 +714,7 @@ int ubi_sync(int ubi_num)
714 if (!ubi) 714 if (!ubi)
715 return -ENODEV; 715 return -ENODEV;
716 716
717 if (ubi->mtd->sync) 717 mtd_sync(ubi->mtd);
718 mtd_sync(ubi->mtd);
719
720 ubi_put_device(ubi); 718 ubi_put_device(ubi);
721 return 0; 719 return 0;
722} 720}
diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index e78bf3cd1b73..5863a369d929 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -336,9 +336,7 @@ static void jffs2_put_super (struct super_block *sb)
336 jffs2_flash_cleanup(c); 336 jffs2_flash_cleanup(c);
337 kfree(c->inocache_list); 337 kfree(c->inocache_list);
338 jffs2_clear_xattr_subsystem(c); 338 jffs2_clear_xattr_subsystem(c);
339 if (c->mtd->sync) 339 mtd_sync(c->mtd);
340 mtd_sync(c->mtd);
341
342 D1(printk(KERN_DEBUG "jffs2_put_super returning\n")); 340 D1(printk(KERN_DEBUG "jffs2_put_super returning\n"));
343} 341}
344 342
diff --git a/fs/logfs/dev_mtd.c b/fs/logfs/dev_mtd.c
index 136c7360a9b6..3f465882ee70 100644
--- a/fs/logfs/dev_mtd.c
+++ b/fs/logfs/dev_mtd.c
@@ -119,8 +119,7 @@ static void logfs_mtd_sync(struct super_block *sb)
119{ 119{
120 struct mtd_info *mtd = logfs_super(sb)->s_mtd; 120 struct mtd_info *mtd = logfs_super(sb)->s_mtd;
121 121
122 if (mtd->sync) 122 mtd_sync(mtd);
123 mtd_sync(mtd);
124} 123}
125 124
126static int logfs_mtd_readpage(void *_sb, struct page *page) 125static int logfs_mtd_readpage(void *_sb, struct page *page)
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index a58ecf4d1f80..305f12b940f4 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -399,7 +399,8 @@ int mtd_writev(struct mtd_info *mtd, const struct kvec *vecs,
399 399
400static inline void mtd_sync(struct mtd_info *mtd) 400static inline void mtd_sync(struct mtd_info *mtd)
401{ 401{
402 mtd->sync(mtd); 402 if (mtd->sync)
403 mtd->sync(mtd);
403} 404}
404 405
405/* Chip-supported device locking */ 406/* Chip-supported device locking */