Add changes from the Linux-2.6 tree.
[linux-2.6.git] / drivers / mtd / maps / ocotea.c
index a21fcd1..5522eac 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/partitions.h>
-#include <linux/config.h>
 #include <asm/io.h>
 #include <asm/ibm44x.h>
 #include <platforms/4xx/ocotea.h>
@@ -98,6 +97,7 @@ int __init init_ocotea(void)
                                        ARRAY_SIZE(ocotea_small_partitions));
        } else {
                printk("map probe failed for flash\n");
+               iounmap(ocotea_small_map.virt);
                return -ENXIO;
        }
 
@@ -107,6 +107,7 @@ int __init init_ocotea(void)
 
        if (!ocotea_large_map.virt) {
                printk("Failed to ioremap flash\n");
+               iounmap(ocotea_small_map.virt);
                return -EIO;
        }
 
@@ -119,6 +120,8 @@ int __init init_ocotea(void)
                                        ARRAY_SIZE(ocotea_large_partitions));
        } else {
                printk("map probe failed for flash\n");
+               iounmap(ocotea_small_map.virt);
+               iounmap(ocotea_large_map.virt);
                return -ENXIO;
        }