Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / drivers / mtd / maps / nettel.c
index 61be5a4..0994b5b 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.10 2005/01/05 17:11:29 dwmw2 Exp $
+ *     $Id: nettel.c,v 1.12 2005/11/29 14:30:00 gleixner Exp $
  */
 
 /****************************************************************************/
@@ -20,6 +20,8 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/cfi.h>
 #include <linux/reboot.h>
+#include <linux/kdev_t.h>
+#include <linux/root_dev.h>
 #include <asm/io.h>
 
 /****************************************************************************/
@@ -128,8 +130,7 @@ static struct mtd_partition nettel_amd_partitions[] = {
        }
 };
 
-#define NUM_AMD_PARTITIONS \
-       (sizeof(nettel_amd_partitions)/sizeof(nettel_amd_partitions[0]))
+#define NUM_AMD_PARTITIONS ARRAY_SIZE(nettel_amd_partitions)
 
 /****************************************************************************/
 
@@ -143,7 +144,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,
@@ -189,7 +190,7 @@ int nettel_eraseconfig(void)
                set_current_state(TASK_INTERRUPTIBLE);
                add_wait_queue(&wait_q, &wait);
 
-               ret = MTD_ERASE(mtd, &nettel_erase);
+               ret = mtd->erase(mtd, &nettel_erase);
                if (ret) {
                        set_current_state(TASK_RUNNING);
                        remove_wait_queue(&wait_q, &wait);
@@ -199,7 +200,7 @@ int nettel_eraseconfig(void)
 
                schedule();  /* Wait for erase to finish. */
                remove_wait_queue(&wait_q, &wait);
-               
+
                put_mtd_device(mtd);
        }
 
@@ -430,7 +431,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 =
@@ -479,7 +480,7 @@ void __exit nettel_cleanup(void)
        }
        if (nettel_intel_map.virt) {
                iounmap(nettel_intel_map.virt);
-               nettel_intel_map.virt = 0;
+               nettel_intel_map.virt = NULL;
        }
 #endif
 }