fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / mtd / maps / ebony.c
index b9d9cf4..1488bb9 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * $Id: ebony.c,v 1.15 2004/12/09 18:39:54 holindho Exp $
- * 
+ * $Id: ebony.c,v 1.16 2005/11/07 11:14:26 gleixner Exp $
+ *
  * Mapping for Ebony user flash
  *
  * Matt Porter <mporter@kernel.crashing.org>
@@ -20,8 +20,6 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/partitions.h>
-#include <linux/config.h>
-#include <linux/version.h>
 #include <asm/io.h>
 #include <asm/ibm44x.h>
 #include <platforms/4xx/ebony.h>
@@ -85,7 +83,7 @@ int __init init_ebony(void)
                small_flash_base = EBONY_SMALL_FLASH_LOW2;
        else
                small_flash_base = EBONY_SMALL_FLASH_LOW1;
-                       
+
        if (EBONY_BOOT_SMALL_FLASH(fpga0_reg) &&
                        !EBONY_ONBRD_FLASH_EN(fpga0_reg))
                large_flash_base = EBONY_LARGE_FLASH_LOW;
@@ -110,6 +108,7 @@ int __init init_ebony(void)
                                        ARRAY_SIZE(ebony_small_partitions));
        } else {
                printk("map probe failed for flash\n");
+               iounmap(ebony_small_map.virt);
                return -ENXIO;
        }
 
@@ -119,6 +118,7 @@ int __init init_ebony(void)
 
        if (!ebony_large_map.virt) {
                printk("Failed to ioremap flash\n");
+               iounmap(ebony_small_map.virt);
                return -EIO;
        }
 
@@ -131,6 +131,8 @@ int __init init_ebony(void)
                                        ARRAY_SIZE(ebony_large_partitions));
        } else {
                printk("map probe failed for flash\n");
+               iounmap(ebony_small_map.virt);
+               iounmap(ebony_large_map.virt);
                return -ENXIO;
        }