]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mtd/maps/sharpsl-flash.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
[linux-2.6-omap-h63xx.git] / drivers / mtd / maps / sharpsl-flash.c
index b7f093fbf9b05396dc1f54a6c14bb3b0c501268e..917dc778f24e12f2c758473c38266804aa517d79 100644 (file)
@@ -1,10 +1,10 @@
 /*
  * sharpsl-flash.c
- * 
+ *
  * Copyright (C) 2001 Lineo Japan, Inc.
  * Copyright (C) 2002  SHARP
  *
- * $Id: sharpsl-flash.c,v 1.5 2005/03/21 08:42:11 rpurdie Exp $
+ * $Id: sharpsl-flash.c,v 1.7 2005/11/07 11:14:28 gleixner Exp $
  *
  * based on rpxlite.c,v 1.15 2001/10/02 15:05:14 dwmw2 Exp
  *          Handle mapping of the flash on the RPX Lite and CLLF boards
@@ -49,15 +49,13 @@ static struct mtd_partition sharpsl_partitions[1] = {
        }
 };
 
-#define NB_OF(x)  (sizeof(x)/sizeof(x[0]))
-
 int __init init_sharpsl(void)
 {
        struct mtd_partition *parts;
        int nb_parts = 0;
        char *part_type = "static";
 
-       printk(KERN_NOTICE "Sharp SL series flash device: %x at %x\n", 
+       printk(KERN_NOTICE "Sharp SL series flash device: %x at %x\n",
                WINDOW_SIZE, WINDOW_ADDR);
        sharpsl_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE);
        if (!sharpsl_map.virt) {
@@ -75,7 +73,7 @@ int __init init_sharpsl(void)
 
        mymtd->owner = THIS_MODULE;
 
-       if (machine_is_corgi() || machine_is_shepherd() || machine_is_husky() 
+       if (machine_is_corgi() || machine_is_shepherd() || machine_is_husky()
                || machine_is_poodle()) {
                sharpsl_partitions[0].size=0x006d0000;
                sharpsl_partitions[0].offset=0x00120000;
@@ -87,14 +85,14 @@ int __init init_sharpsl(void)
                sharpsl_partitions[0].offset=0x00140000;
        } else {
                map_destroy(mymtd);
-               iounmap(sharpsl_map.virt);      
+               iounmap(sharpsl_map.virt);
                return -ENODEV;
        }
-       
+
        parts = sharpsl_partitions;
-       nb_parts = NB_OF(sharpsl_partitions);
+       nb_parts = ARRAY_SIZE(sharpsl_partitions);
 
-       printk(KERN_NOTICE "Using %s partision definition\n", part_type);
+       printk(KERN_NOTICE "Using %s partition definition\n", part_type);
        add_mtd_partitions(mymtd, parts, nb_parts);
 
        return 0;