linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / mtd / maps / nettel.c
index a6014b6..632eb2a 100644 (file)
@@ -6,7 +6,7 @@
  *      (C) Copyright 2000-2001, Greg Ungerer (gerg@snapgear.com)
  *      (C) Copyright 2001-2002, SnapGear (www.snapgear.com)
  *
- *     $Id: nettel.c,v 1.8 2004/11/04 13:24:15 gleixner Exp $
+ *     $Id: nettel.c,v 1.12 2005/11/29 14:30:00 gleixner Exp $
  */
 
 /****************************************************************************/
@@ -143,7 +143,7 @@ static int nettel_reboot_notifier(struct notifier_block *nb, unsigned long val,
 {
        struct cfi_private *cfi = nettel_intel_map.fldrv_priv;
        unsigned long b;
-       
+
        /* Make sure all FLASH chips are put back into read mode */
        for (b = 0; (b < nettel_intel_partitions[3].size); b += 0x100000) {
                cfi_send_gen_cmd(0xff, 0x55, b, &nettel_intel_map, cfi,
@@ -199,7 +199,7 @@ int nettel_eraseconfig(void)
 
                schedule();  /* Wait for erase to finish. */
                remove_wait_queue(&wait_q, &wait);
-               
+
                put_mtd_device(mtd);
        }
 
@@ -332,8 +332,8 @@ int __init nettel_init(void)
 
                /* Destroy useless AMD MTD mapping */
                amd_mtd = NULL;
-               iounmap((void *) nettel_amd_map.virt);
-               nettel_amd_map.virt = (unsigned long) NULL;
+               iounmap(nettel_amd_map.virt);
+               nettel_amd_map.virt = NULL;
 #else
                /* Only AMD flash supported */
                return(-ENXIO);
@@ -357,8 +357,7 @@ int __init nettel_init(void)
        /* Probe for the the size of the first Intel flash */
        nettel_intel_map.size = maxsize;
        nettel_intel_map.phys = intel0addr;
-       nettel_intel_map.virt = (unsigned long)
-               ioremap_nocache(intel0addr, maxsize);
+       nettel_intel_map.virt = ioremap_nocache(intel0addr, maxsize);
        if (!nettel_intel_map.virt) {
                printk("SNAPGEAR: failed to ioremap() ROMCS1\n");
                return(-EIO);
@@ -366,8 +365,8 @@ int __init nettel_init(void)
        simple_map_init(&nettel_intel_map);
 
        intel_mtd = do_map_probe("cfi_probe", &nettel_intel_map);
-       if (! intel_mtd) {
-               iounmap((void *) nettel_intel_map.virt);
+       if (!intel_mtd) {
+               iounmap(nettel_intel_map.virt);
                return(-ENXIO);
        }
 
@@ -388,11 +387,10 @@ int __init nettel_init(void)
        /* Delete the old map and probe again to do both chips */
        map_destroy(intel_mtd);
        intel_mtd = NULL;
-       iounmap((void *) nettel_intel_map.virt);
+       iounmap(nettel_intel_map.virt);
 
        nettel_intel_map.size = maxsize;
-       nettel_intel_map.virt = (unsigned long)
-               ioremap_nocache(intel0addr, maxsize);
+       nettel_intel_map.virt = ioremap_nocache(intel0addr, maxsize);
        if (!nettel_intel_map.virt) {
                printk("SNAPGEAR: failed to ioremap() ROMCS1/2\n");
                return(-EIO);
@@ -432,7 +430,7 @@ int __init nettel_init(void)
                nettel_intel_partitions[1].size = (intel0size + intel1size) -
                        (1024*1024 + intel_mtd->erasesize);
                nettel_intel_partitions[3].size = intel0size + intel1size;
-               nettel_intel_partitions[4].offset = 
+               nettel_intel_partitions[4].offset =
                        (intel0size + intel1size) - intel_mtd->erasesize;
                nettel_intel_partitions[4].size = intel_mtd->erasesize;
                nettel_intel_partitions[5].offset =
@@ -480,8 +478,8 @@ void __exit nettel_cleanup(void)
                map_destroy(intel_mtd);
        }
        if (nettel_intel_map.virt) {
-               iounmap((void *)nettel_intel_map.virt);
-               nettel_intel_map.virt = 0;
+               iounmap(nettel_intel_map.virt);
+               nettel_intel_map.virt = NULL;
        }
 #endif
 }