if (queued) {
pr_debug("ftl_cs: waiting for transfer "
"unit to be prepared...\n");
- if (part->mbd.mtd->sync)
- mtd_sync(part->mbd.mtd);
+ mtd_sync(part->mbd.mtd);
} else {
static int ne = 0;
if (++ne < 5)
if (!--mtdblk->count) {
/* It was the last usage. Free the cache */
- if (mbd->mtd->sync)
- mtd_sync(mbd->mtd);
+ mtd_sync(mbd->mtd);
vfree(mtdblk->cache_data);
}
mutex_lock(&mtdblk->cache_mutex);
write_cached_data(mtdblk);
mutex_unlock(&mtdblk->cache_mutex);
-
- if (dev->mtd->sync)
- mtd_sync(dev->mtd);
+ mtd_sync(dev->mtd);
return 0;
}
pr_debug("MTD_close\n");
/* Only sync if opened RW */
- if ((file->f_mode & FMODE_WRITE) && mtd->sync)
+ if ((file->f_mode & FMODE_WRITE))
mtd_sync(mtd);
iput(mfi->ino);
{
struct mtdswap_dev *d = MTDSWAP_MBD_TO_MTDSWAP(dev);
- if (d->mtd->sync)
- mtd_sync(d->mtd);
+ mtd_sync(d->mtd);
return 0;
}
int rc;
/* we have a race if sync doesn't exist */
- if (part->mbd.mtd->sync)
- mtd_sync(part->mbd.mtd);
+ mtd_sync(part->mbd.mtd);
score = 0x7fffffff; /* MAX_INT */
best_block = -1;
if (!ubi)
return -ENODEV;
- if (ubi->mtd->sync)
- mtd_sync(ubi->mtd);
-
+ mtd_sync(ubi->mtd);
ubi_put_device(ubi);
return 0;
}
jffs2_flash_cleanup(c);
kfree(c->inocache_list);
jffs2_clear_xattr_subsystem(c);
- if (c->mtd->sync)
- mtd_sync(c->mtd);
-
+ mtd_sync(c->mtd);
D1(printk(KERN_DEBUG "jffs2_put_super returning\n"));
}
{
struct mtd_info *mtd = logfs_super(sb)->s_mtd;
- if (mtd->sync)
- mtd_sync(mtd);
+ mtd_sync(mtd);
}
static int logfs_mtd_readpage(void *_sb, struct page *page)
static inline void mtd_sync(struct mtd_info *mtd)
{
- mtd->sync(mtd);
+ if (mtd->sync)
+ mtd->sync(mtd);
}
/* Chip-supported device locking */