fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / mtd / maps / walnut.c
index d6137b1..ca93212 100644 (file)
@@ -1,12 +1,12 @@
 /*
- * $Id: walnut.c,v 1.2 2004/12/10 12:07:42 holindho Exp $
- * 
+ * $Id: walnut.c,v 1.3 2005/11/07 11:14:29 gleixner Exp $
+ *
  * Mapping for Walnut flash
  * (used ebony.c as a "framework")
- * 
+ *
  * Heikki Lindholm <holindho@infradead.org>
- * 
- * 
+ *
+ *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
  * Free Software Foundation;  either version 2 of the  License, or (at your
@@ -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/ibm4xx.h>
 #include <platforms/4xx/walnut.h>
@@ -48,7 +46,7 @@ static struct mtd_partition walnut_partitions[] = {
                .name =   "OpenBIOS",
                .offset = 0x0,
                .size =   WALNUT_FLASH_SIZE,
-               /*.mask_flags = MTD_WRITEABLE, */ /* force read-only */         
+               /*.mask_flags = MTD_WRITEABLE, */ /* force read-only */
        }
 };
 
@@ -70,19 +68,21 @@ int __init init_walnut(void)
 
        if (WALNUT_FLASH_ONBD_N(fpga_brds1)) {
                printk("The on-board flash is disabled (U79 sw 5)!");
+               iounmap(fpga_status_adr);
                return -EIO;
        }
-       if (WALNUT_FLASH_SRAM_SEL(fpga_brds1)) 
+       if (WALNUT_FLASH_SRAM_SEL(fpga_brds1))
                flash_base = WALNUT_FLASH_LOW;
        else
                flash_base = WALNUT_FLASH_HIGH;
-       
+
        walnut_map.phys = flash_base;
        walnut_map.virt =
                (void __iomem *)ioremap(flash_base, walnut_map.size);
 
        if (!walnut_map.virt) {
                printk("Failed to ioremap flash.\n");
+               iounmap(fpga_status_adr);
                return -EIO;
        }
 
@@ -95,9 +95,11 @@ int __init init_walnut(void)
                                        ARRAY_SIZE(walnut_partitions));
        } else {
                printk("map probe failed for flash\n");
+               iounmap(fpga_status_adr);
                return -ENXIO;
        }
 
+       iounmap(fpga_status_adr);
        return 0;
 }