ALSA: make snd_ctl_elem_read() and snd_ctl_elem_write() static
[safe/jmp/linux-2.6] / drivers / mtd / maps / tqm8xxl.c
index 9cb5d67..5217340 100644 (file)
@@ -22,7 +22,6 @@
  * Thus, we choose CONFIG_MTD_CFI_I2 & CONFIG_MTD_CFI_B4 at
  * kernel configuration.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
@@ -125,7 +124,7 @@ int __init init_tqm_mtd(void)
        //request maximum flash size address space
        start_scan_addr = ioremap(flash_addr, flash_size);
        if (!start_scan_addr) {
-               printk(KERN_WARNING "%s:Failed to ioremap address:0x%x\n", __FUNCTION__, flash_addr);
+               printk(KERN_WARNING "%s:Failed to ioremap address:0x%x\n", __func__, flash_addr);
                return -EIO;
        }
 
@@ -133,16 +132,15 @@ int __init init_tqm_mtd(void)
                if(mtd_size >= flash_size)
                        break;
 
-               printk(KERN_INFO "%s: chip probing count %d\n", __FUNCTION__, idx);
+               printk(KERN_INFO "%s: chip probing count %d\n", __func__, 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;
                        /* FIXME: What if some MTD devices were probed already? */
                        goto error_mem;
                }
 
-               memset((void *)map_banks[idx], 0, sizeof(struct map_info));
                map_banks[idx]->name = (char *)kmalloc(16, GFP_KERNEL);
 
                if (!map_banks[idx]->name) {
@@ -180,7 +178,7 @@ int __init init_tqm_mtd(void)
                        mtd_size += mtd_banks[idx]->size;
                        num_banks++;
 
-                       printk(KERN_INFO "%s: bank%d, name:%s, size:%dbytes \n", __FUNCTION__, num_banks,
+                       printk(KERN_INFO "%s: bank%d, name:%s, size:%dbytes \n", __func__, num_banks,
                        mtd_banks[idx]->name, mtd_banks[idx]->size);
                }
        }
@@ -224,10 +222,8 @@ int __init init_tqm_mtd(void)
 error_mem:
        for(idx = 0 ; idx < FLASH_BANK_MAX ; idx++) {
                if(map_banks[idx] != NULL) {
-                       if(map_banks[idx]->name != NULL) {
-                               kfree(map_banks[idx]->name);
-                               map_banks[idx]->name = NULL;
-                       }
+                       kfree(map_banks[idx]->name);
+                       map_banks[idx]->name = NULL;
                        kfree(map_banks[idx]);
                        map_banks[idx] = NULL;
                }