fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / mtd / maps / arctic-mtd.c
index c111b2d..2cc9024 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * $Id: arctic-mtd.c,v 1.10 2003/06/02 16:37:59 trini Exp $
- * 
- * drivers/mtd/maps/arctic-mtd.c MTD mappings and partition tables for 
+ * $Id: arctic-mtd.c,v 1.14 2005/11/07 11:14:26 gleixner Exp $
+ *
+ * drivers/mtd/maps/arctic-mtd.c MTD mappings and partition tables for
  *                              IBM 405LP Arctic boards.
  *
  * This program is free software; you can redistribute it and/or modify
@@ -72,7 +72,7 @@
 static struct map_info arctic_mtd_map = {
        .name           = NAME,
        .size           = SIZE,
-       .buswidth       = BUSWIDTH,
+       .bankwidth      = BUSWIDTH,
        .phys           = PADDR,
 };
 
@@ -96,9 +96,11 @@ static struct mtd_partition arctic_partitions[PARTITIONS] = {
 static int __init
 init_arctic_mtd(void)
 {
+       int err;
+
        printk("%s: 0x%08x at 0x%08x\n", NAME, SIZE, PADDR);
 
-       arctic_mtd_map.virt = (unsigned long) ioremap(PADDR, SIZE);
+       arctic_mtd_map.virt = ioremap(PADDR, SIZE);
 
        if (!arctic_mtd_map.virt) {
                printk("%s: failed to ioremap 0x%x\n", NAME, PADDR);
@@ -109,12 +111,20 @@ init_arctic_mtd(void)
        printk("%s: probing %d-bit flash bus\n", NAME, BUSWIDTH * 8);
        arctic_mtd = do_map_probe("cfi_probe", &arctic_mtd_map);
 
-       if (!arctic_mtd)
+       if (!arctic_mtd) {
+               iounmap(arctic_mtd_map.virt);
                return -ENXIO;
+       }
 
        arctic_mtd->owner = THIS_MODULE;
 
-       return add_mtd_partitions(arctic_mtd, arctic_partitions, PARTITIONS);
+       err = add_mtd_partitions(arctic_mtd, arctic_partitions, PARTITIONS);
+       if (err) {
+               printk("%s: add_mtd_partitions failed\n", NAME);
+               iounmap(arctic_mtd_map.virt);
+       }
+
+       return err;
 }
 
 static void __exit