diff options
Diffstat (limited to 'drivers/mtd/mtdchar.c')
-rw-r--r-- | drivers/mtd/mtdchar.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 8c86b802f212..942c88ec5b6a 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -135,7 +135,8 @@ static int mtd_close(struct inode *inode, struct file *file) | |||
135 | 135 | ||
136 | DEBUG(MTD_DEBUG_LEVEL0, "MTD_close\n"); | 136 | DEBUG(MTD_DEBUG_LEVEL0, "MTD_close\n"); |
137 | 137 | ||
138 | if (mtd->sync) | 138 | /* Only sync if opened RW */ |
139 | if ((file->f_mode & 2) && mtd->sync) | ||
139 | mtd->sync(mtd); | 140 | mtd->sync(mtd); |
140 | 141 | ||
141 | put_mtd_device(mtd); | 142 | put_mtd_device(mtd); |