mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 12:16:20 +00:00
[MTD] Only call mtd->sync() method in mtdchar close if opened for write.
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
This commit is contained in:
parent
fd5324909e
commit
7eafaed55f
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue