fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / mtd / maps / ceiva.c
index 8475505..629e6e2 100644 (file)
  *
  * (C) 2000 Nicolas Pitre <nico@cam.org>
  *
- * $Id: ceiva.c,v 1.10 2004/07/12 21:59:43 dwmw2 Exp $
+ * $Id: ceiva.c,v 1.11 2004/09/16 23:27:12 gleixner Exp $
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/slab.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
@@ -122,10 +122,9 @@ static int __init clps_setup_mtd(struct clps_info *clps, int nr, struct mtd_info
        /*
         * Allocate the map_info structs in one go.
         */
-       maps = kmalloc(sizeof(struct map_info) * nr, GFP_KERNEL);
+       maps = kzalloc(sizeof(struct map_info) * nr, GFP_KERNEL);
        if (!maps)
                return -ENOMEM;
-       memset(maps, 0, sizeof(struct map_info) * nr);
        /*
         * Claim and then map the memory regions.
         */
@@ -150,7 +149,7 @@ static int __init clps_setup_mtd(struct clps_info *clps, int nr, struct mtd_info
                        break;
                }
 
-               clps[i].map->virt = (unsigned long)clps[i].vbase;
+               clps[i].map->virt = (void __iomem *)clps[i].vbase;
                clps[i].map->bankwidth = clps[i].width;
                clps[i].map->size = clps[i].size;
 
@@ -312,8 +311,7 @@ static void __init clps_locate_partitions(struct mtd_info *mtd)
 
 static void __exit clps_destroy_partitions(void)
 {
-       if (parsed_parts)
-               kfree(parsed_parts);
+       kfree(parsed_parts);
 }
 
 static struct mtd_info *mymtd;