Commit 76a5027c authored by Amol Lad's avatar Amol Lad Committed by David Woodhouse

[MTD] Cleanup of 'ioremap balanced with iounmap for drivers/mtd subsystem'

Updated version of patch, in response to comments from Francois Romieu
<romieu@fr.zoreil.com>

Remove gratuitous casts from iounmap and initialisation of variables.
Signed-off-by: default avatarAmol Lad <amol@verismonetworks.com>
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent 553a8012
...@@ -96,7 +96,7 @@ static struct mtd_partition arctic_partitions[PARTITIONS] = { ...@@ -96,7 +96,7 @@ static struct mtd_partition arctic_partitions[PARTITIONS] = {
static int __init static int __init
init_arctic_mtd(void) init_arctic_mtd(void)
{ {
int err = 0; int err;
printk("%s: 0x%08x at 0x%08x\n", NAME, SIZE, PADDR); printk("%s: 0x%08x at 0x%08x\n", NAME, SIZE, PADDR);
...@@ -112,7 +112,7 @@ init_arctic_mtd(void) ...@@ -112,7 +112,7 @@ init_arctic_mtd(void)
arctic_mtd = do_map_probe("cfi_probe", &arctic_mtd_map); arctic_mtd = do_map_probe("cfi_probe", &arctic_mtd_map);
if (!arctic_mtd) { if (!arctic_mtd) {
iounmap((void *) arctic_mtd_map.virt); iounmap(arctic_mtd_map.virt);
return -ENXIO; return -ENXIO;
} }
...@@ -121,7 +121,7 @@ init_arctic_mtd(void) ...@@ -121,7 +121,7 @@ init_arctic_mtd(void)
err = add_mtd_partitions(arctic_mtd, arctic_partitions, PARTITIONS); err = add_mtd_partitions(arctic_mtd, arctic_partitions, PARTITIONS);
if (err) { if (err) {
printk("%s: add_mtd_partitions failed\n", NAME); printk("%s: add_mtd_partitions failed\n", NAME);
iounmap((void *) arctic_mtd_map.virt); iounmap(arctic_mtd_map.virt);
} }
return err; return err;
......
...@@ -72,7 +72,7 @@ static struct mtd_partition beech_partitions[2] = { ...@@ -72,7 +72,7 @@ static struct mtd_partition beech_partitions[2] = {
static int __init static int __init
init_beech_mtd(void) init_beech_mtd(void)
{ {
int err = 0; int err;
printk("%s: 0x%08x at 0x%08x\n", NAME, SIZE, PADDR); printk("%s: 0x%08x at 0x%08x\n", NAME, SIZE, PADDR);
...@@ -89,7 +89,7 @@ init_beech_mtd(void) ...@@ -89,7 +89,7 @@ init_beech_mtd(void)
beech_mtd = do_map_probe("cfi_probe", &beech_mtd_map); beech_mtd = do_map_probe("cfi_probe", &beech_mtd_map);
if (!beech_mtd) { if (!beech_mtd) {
iounmap((void *) beech_mtd_map.virt); iounmap(beech_mtd_map.virt);
return -ENXIO; return -ENXIO;
} }
...@@ -98,7 +98,7 @@ init_beech_mtd(void) ...@@ -98,7 +98,7 @@ init_beech_mtd(void)
err = add_mtd_partitions(beech_mtd, beech_partitions, 2); err = add_mtd_partitions(beech_mtd, beech_partitions, 2);
if (err) { if (err) {
printk("%s: add_mtd_partitions failed\n", NAME); printk("%s: add_mtd_partitions failed\n", NAME);
iounmap((void *) beech_mtd_map.virt); iounmap(beech_mtd_map.virt);
} }
return err; return err;
......
...@@ -175,8 +175,8 @@ int __init init_cstm_mips_ixx(void) ...@@ -175,8 +175,8 @@ int __init init_cstm_mips_ixx(void)
printk(KERN_WARNING "Failed to ioremap\n"); printk(KERN_WARNING "Failed to ioremap\n");
for (j = 0; j < i; j++) { for (j = 0; j < i; j++) {
if (cstm_mips_ixx_map[j].virt) { if (cstm_mips_ixx_map[j].virt) {
iounmap((void *)cstm_mips_ixx_map[j].virt); iounmap(cstm_mips_ixx_map[j].virt);
cstm_mips_ixx_map[j].virt = 0; cstm_mips_ixx_map[j].virt = NULL;
} }
} }
return -EIO; return -EIO;
...@@ -214,8 +214,8 @@ int __init init_cstm_mips_ixx(void) ...@@ -214,8 +214,8 @@ int __init init_cstm_mips_ixx(void)
else { else {
for (i = 0; i < PHYSMAP_NUMBER; i++) { for (i = 0; i < PHYSMAP_NUMBER; i++) {
if (cstm_mips_ixx_map[i].virt) { if (cstm_mips_ixx_map[i].virt) {
iounmap((void *)cstm_mips_ixx_map[i].virt); iounmap(cstm_mips_ixx_map[i].virt);
cstm_mips_ixx_map[i].virt = 0; cstm_mips_ixx_map[i].virt = NULL;
} }
} }
return -ENXIO; return -ENXIO;
......
...@@ -463,7 +463,7 @@ int __init nettel_init(void) ...@@ -463,7 +463,7 @@ int __init nettel_init(void)
#ifdef CONFIG_MTD_CFI_INTELEXT #ifdef CONFIG_MTD_CFI_INTELEXT
out_unmap1: out_unmap1:
iounmap((void *) nettel_intel_map.virt); iounmap(nettel_intel_map.virt);
#endif #endif
out_unmap2: out_unmap2:
......
...@@ -126,7 +126,7 @@ static struct mtd_info *redwood_mtd; ...@@ -126,7 +126,7 @@ static struct mtd_info *redwood_mtd;
int __init init_redwood_flash(void) int __init init_redwood_flash(void)
{ {
int err = 0; int err;
printk(KERN_NOTICE "redwood: flash mapping: %x at %x\n", printk(KERN_NOTICE "redwood: flash mapping: %x at %x\n",
WINDOW_SIZE, WINDOW_ADDR); WINDOW_SIZE, WINDOW_ADDR);
......
...@@ -199,7 +199,7 @@ static void __exit ep7312_cleanup(void) ...@@ -199,7 +199,7 @@ static void __exit ep7312_cleanup(void)
nand_release(ap7312_mtd); nand_release(ap7312_mtd);
/* Release io resource */ /* Release io resource */
iounmap((void *)this->IO_ADDR_R); iounmap(this->IO_ADDR_R);
/* Free the MTD device structure */ /* Free the MTD device structure */
kfree(ep7312_mtd); kfree(ep7312_mtd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment