* Both parts are JEDEC compatible.
*/
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
}
};
-#define NUM_FLASH_BANKS ARRAY_SIZE(sbc8240_map)
+#define NUM_FLASH_BANKS (sizeof(sbc8240_map) / sizeof(struct map_info))
/*
* The following defines the partition layout of SBC8240 boards.
}
};
+#define NB_OF(x) (sizeof (x) / sizeof (x[0]))
+
/* trivial struct to describe partition information */
struct mtd_part_def
{
#ifdef CONFIG_MTD_PARTITIONS
sbc8240_part_banks[0].mtd_part = sbc8240_uboot_partitions;
sbc8240_part_banks[0].type = "static image";
- sbc8240_part_banks[0].nums = ARRAY_SIZE(sbc8240_uboot_partitions);
+ sbc8240_part_banks[0].nums = NB_OF(sbc8240_uboot_partitions);
sbc8240_part_banks[1].mtd_part = sbc8240_fs_partitions;
sbc8240_part_banks[1].type = "static file system";
- sbc8240_part_banks[1].nums = ARRAY_SIZE(sbc8240_fs_partitions);
+ sbc8240_part_banks[1].nums = NB_OF(sbc8240_fs_partitions);
for (i = 0; i < NUM_FLASH_BANKS; i++) {