]> Pileus Git - ~andy/linux/blobdiff - drivers/mtd/maps/redwood.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[~andy/linux] / drivers / mtd / maps / redwood.c
index ec8fdae1dd99c87fca4e2078a1ca7b1a81a08588..de002eb1a7fe3a943753b2622a2dd64f7cea909a 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: redwood.c,v 1.11 2005/11/07 11:14:28 gleixner Exp $
- *
  * drivers/mtd/maps/redwood.c
  *
  * FLASH map for the IBM Redwood 4/5/6 boards.
@@ -126,6 +124,8 @@ static struct mtd_info *redwood_mtd;
 
 int __init init_redwood_flash(void)
 {
+       int err;
+
        printk(KERN_NOTICE "redwood: flash mapping: %x at %x\n",
                        WINDOW_SIZE, WINDOW_ADDR);
 
@@ -141,11 +141,18 @@ int __init init_redwood_flash(void)
 
        if (redwood_mtd) {
                redwood_mtd->owner = THIS_MODULE;
-               return add_mtd_partitions(redwood_mtd,
+               err = add_mtd_partitions(redwood_mtd,
                                redwood_flash_partitions,
                                NUM_REDWOOD_FLASH_PARTITIONS);
+               if (err) {
+                       printk("init_redwood_flash: add_mtd_partitions failed\n");
+                       iounmap(redwood_flash_map.virt);
+               }
+               return err;
+
        }
 
+       iounmap(redwood_flash_map.virt);
        return -ENXIO;
 }