提交 7eafaed5 编写于 作者: J Joakim Tjernlund 提交者: David Woodhouse

[MTD] Only call mtd->sync() method in mtdchar close if opened for write.

Signed-off-by: NJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
上级 fd532490
......@@ -135,7 +135,8 @@ static int mtd_close(struct inode *inode, struct file *file)
DEBUG(MTD_DEBUG_LEVEL0, "MTD_close\n");
if (mtd->sync)
/* Only sync if opened RW */
if ((file->f_mode & 2) && mtd->sync)
mtd->sync(mtd);
put_mtd_device(mtd);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册