linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / mtd / mtdblock_ro.c
index 29563ed..0c830ba 100644 (file)
@@ -45,7 +45,9 @@ static void mtdblock_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
        dev->blksize = 512;
        dev->size = mtd->size >> 9;
        dev->tr = tr;
-       dev->readonly = 1;
+       if ((mtd->flags & (MTD_CLEAR_BITS|MTD_SET_BITS|MTD_WRITEABLE)) !=
+           (MTD_CLEAR_BITS|MTD_SET_BITS|MTD_WRITEABLE))
+               dev->readonly = 1;
 
        add_mtd_blktrans_dev(dev);
 }