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 / dbox2-flash.c
index 7c4de43..92a9c7f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: dbox2-flash.c,v 1.11 2004/07/12 21:59:43 dwmw2 Exp $
+ * $Id: dbox2-flash.c,v 1.14 2005/11/07 11:14:26 gleixner Exp $
  *
  * D-Box 2 flash driver
  */
@@ -12,7 +12,6 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/partitions.h>
-#include <linux/config.h>
 #include <linux/errno.h>
 
 /* partition_info gives details on the logical partitions that the split the
 static struct mtd_partition partition_info[]= {
        {
        .name           = "BR bootloader",
-       .size           = 128 * 1024, 
-       .offset         = 0,                  
+       .size           = 128 * 1024,
+       .offset         = 0,
        .mask_flags     = MTD_WRITEABLE
        },
        {
        .name           = "FLFS (U-Boot)",
-       .size           = 128 * 1024, 
-       .offset         = MTDPART_OFS_APPEND, 
+       .size           = 128 * 1024,
+       .offset         = MTDPART_OFS_APPEND,
        .mask_flags     = 0
        },
        {
-       .name           = "Root (SquashFS)",    
-       .size           = 7040 * 1024, 
-       .offset         = MTDPART_OFS_APPEND, 
+       .name           = "Root (SquashFS)",
+       .size           = 7040 * 1024,
+       .offset         = MTDPART_OFS_APPEND,
        .mask_flags     = 0
        },
        {
        .name           = "var (JFFS2)",
-       .size           = 896 * 1024, 
-       .offset         = MTDPART_OFS_APPEND, 
+       .size           = 896 * 1024,
+       .offset         = MTDPART_OFS_APPEND,
        .mask_flags     = 0
        },
        {
-       .name           = "Flash without bootloader",   
-       .size           = MTDPART_SIZ_FULL, 
-       .offset         = 128 * 1024, 
+       .name           = "Flash without bootloader",
+       .size           = MTDPART_SIZ_FULL,
+       .offset         = 128 * 1024,
        .mask_flags     = 0
        },
        {
-       .name           = "Complete Flash",     
-       .size           = MTDPART_SIZ_FULL, 
-       .offset         = 0, 
+       .name           = "Complete Flash",
+       .size           = MTDPART_SIZ_FULL,
+       .offset         = 0,
        .mask_flags     = MTD_WRITEABLE
        }
 };
 
-#define NUM_PARTITIONS (sizeof(partition_info) / sizeof(partition_info[0]))
+#define NUM_PARTITIONS ARRAY_SIZE(partition_info)
 
 #define WINDOW_ADDR 0x10000000
 #define WINDOW_SIZE 0x800000
@@ -75,7 +74,7 @@ struct map_info dbox2_flash_map = {
 int __init init_dbox2_flash(void)
 {
                printk(KERN_NOTICE "D-Box 2 flash driver (size->0x%X mem->0x%X)\n", WINDOW_SIZE, WINDOW_ADDR);
-       dbox2_flash_map.virt = (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
+       dbox2_flash_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE);
 
        if (!dbox2_flash_map.virt) {
                printk("Failed to ioremap\n");
@@ -88,16 +87,16 @@ int __init init_dbox2_flash(void)
        if (!mymtd) {
            // Probe for single Intel 28F640
            dbox2_flash_map.bankwidth = 2;
-       
+
            mymtd = do_map_probe("cfi_probe", &dbox2_flash_map);
        }
-           
+
        if (mymtd) {
                mymtd->owner = THIS_MODULE;
 
                 /* Create MTD devices for each partition. */
                add_mtd_partitions(mymtd, partition_info, NUM_PARTITIONS);
-               
+
                return 0;
        }
 
@@ -122,5 +121,5 @@ module_exit(cleanup_dbox2_flash);
 
 
 MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Kári Davíðsson <kd@flaga.is>, Bastian Blank <waldi@tuxbox.org>, Alexander Wild <wild@te-elektronik.com>");
+MODULE_AUTHOR("Kári Davíðsson <kd@flaga.is>, Bastian Blank <waldi@tuxbox.org>, Alexander Wild <wild@te-elektronik.com>");
 MODULE_DESCRIPTION("MTD map driver for D-Box 2 board");