linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / mtd / maps / ocotea.c
index 2f07602..c223514 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/partitions.h>
+#include <linux/config.h>
 #include <asm/io.h>
 #include <asm/ibm44x.h>
 #include <platforms/4xx/ocotea.h>
@@ -57,6 +58,8 @@ static struct mtd_partition ocotea_large_partitions[] = {
        }
 };
 
+#define NB_OF(x)  (sizeof(x)/sizeof(x[0]))
+
 int __init init_ocotea(void)
 {
        u8 fpga0_reg;
@@ -94,7 +97,7 @@ int __init init_ocotea(void)
        if (flash) {
                flash->owner = THIS_MODULE;
                add_mtd_partitions(flash, ocotea_small_partitions,
-                                       ARRAY_SIZE(ocotea_small_partitions));
+                                       NB_OF(ocotea_small_partitions));
        } else {
                printk("map probe failed for flash\n");
                return -ENXIO;
@@ -115,7 +118,7 @@ int __init init_ocotea(void)
        if (flash) {
                flash->owner = THIS_MODULE;
                add_mtd_partitions(flash, ocotea_large_partitions,
-                                       ARRAY_SIZE(ocotea_large_partitions));
+                                       NB_OF(ocotea_large_partitions));
        } else {
                printk("map probe failed for flash\n");
                return -ENXIO;