[MTD] replace kmalloc+memset with kzalloc
[safe/jmp/linux-2.6] / drivers / mtd / maps / tqm834x.c
index d0bc959..9adc970 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/types.h>
@@ -133,20 +132,16 @@ static int __init init_tqm834x_mtd(void)
 
                pr_debug("%s: chip probing count %d\n", __FUNCTION__, idx);
 
-               map_banks[idx] = 
-                       (struct map_info *)kmalloc(sizeof(struct map_info),
-                                                  GFP_KERNEL);
+               map_banks[idx] = kzalloc(sizeof(struct map_info), GFP_KERNEL);
                if (map_banks[idx] == NULL) {
                        ret = -ENOMEM;
                        goto error_mem;
                }
-               memset((void *)map_banks[idx], 0, sizeof(struct map_info));
-               map_banks[idx]->name = (char *)kmalloc(16, GFP_KERNEL);
+               map_banks[idx]->name = kzalloc(16, GFP_KERNEL);
                if (map_banks[idx]->name == NULL) {
                        ret = -ENOMEM;
                        goto error_mem;
                }
-               memset((void *)map_banks[idx]->name, 0, 16);
 
                sprintf(map_banks[idx]->name, "TQM834x-%d", idx);
                map_banks[idx]->size = flash_size;
@@ -193,7 +188,7 @@ static int __init init_tqm834x_mtd(void)
        tqm834x_partitions_bank1[n - 1].size =
                mtd_banks[0]->size -
                tqm834x_partitions_bank1[n - 1].offset;
-       
+
        /* check if we have second bank? */
        if (num_banks == 2) {
                n = ARRAY_SIZE(tqm834x_partitions_bank2);
@@ -227,11 +222,11 @@ static int __init init_tqm834x_mtd(void)
                               "available, registering whole device\n", idx);
                        add_mtd_device(mtd_banks[idx]);
                } else {
-                       printk(KERN_NOTICE 
+                       printk(KERN_NOTICE
                               "TQM834x flash bank %d: Using %s partition "
                               "definition\n", idx, part_banks[idx].type);
                        add_mtd_partitions(mtd_banks[idx],
-                                          part_banks[idx].mtd_part, 
+                                          part_banks[idx].mtd_part,
                                           part_banks[idx].nums);
                }
        }