]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mtd/mtdchar.c
sis190: scheduling while atomic error
[linux-2.6-omap-h63xx.git] / drivers / mtd / mtdchar.c
index d091b2430b480254c4cb2743a28def0e6805486a..22ed96c4b7bd75a7bedd4a9936f78f9094a7a95a 100644 (file)
@@ -136,7 +136,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);