]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mtd/maps/omap_nor.c
Merge current mainline tree into linux-omap tree
[linux-2.6-omap-h63xx.git] / drivers / mtd / maps / omap_nor.c
index 240b0e2d095d6bade93555986d0cd09cc163aa80..dca13a77f245440361d8450d16a129dacfd2a2b1 100644 (file)
@@ -61,12 +61,14 @@ static void omap_set_vpp(struct map_info *map, int enable)
 {
        static int      count;
 
-       if (enable) {
-               if (count++ == 0)
-                       OMAP_EMIFS_CONFIG_REG |= OMAP_EMIFS_CONFIG_WP;
-       } else {
-               if (count && (--count == 0))
-                       OMAP_EMIFS_CONFIG_REG &= ~OMAP_EMIFS_CONFIG_WP;
+       if (cpu_class_is_omap1()) {
+               if (enable) {
+                       if (count++ == 0)
+                               OMAP_EMIFS_CONFIG_REG |= OMAP_EMIFS_CONFIG_WP;
+               } else {
+                       if (count && (--count == 0))
+                               OMAP_EMIFS_CONFIG_REG &= ~OMAP_EMIFS_CONFIG_WP;
+               }
        }
 }
 
@@ -133,11 +135,12 @@ out_free_info:
 static int __exit omapflash_remove(struct platform_device *pdev)
 {
        struct omapflash_info *info = platform_get_drvdata(pdev);
+       struct flash_platform_data *pdata = pdev->dev.platform_data;
 
        platform_set_drvdata(pdev, NULL);
 
        if (info) {
-               if (info->parts) {
+               if (info->parts || (pdata && pdata->parts)) {
                        del_mtd_partitions(info->mtd);
                        kfree(info->parts);
                } else