mtd: cfi - if defined, use MAX_FLASH_BANKS_DETECT for static declarations
authorKim Phillips <kim.phillips@freescale.com>
Tue, 14 Jul 2009 21:00:24 +0000 (16:00 -0500)
committerStefan Roese <sr@denx.de>
Thu, 16 Jul 2009 13:27:45 +0000 (15:27 +0200)
a.k.a cfi_mtd.c does as cfi_flash.c does.  This also prevents
the TQM834x build from doing a:

cfi_mtd.c:36: error: variably modified 'cfi_mtd_info' at file scope
cfi_mtd.c:37: error: variably modified 'cfi_mtd_names' at file scope

using gcc 4.4.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Stefan Roese <sr@denx.de>
drivers/mtd/cfi_mtd.c

index c7e357b7f2a23fbea9b9af3ddda69ae57e3bd504..34748dda2651d088a6635a70927c01d9fe32faa1 100644 (file)
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/concat.h>
 
+/* use CONFIG_SYS_MAX_FLASH_BANKS_DETECT if defined */
+#ifdef CONFIG_SYS_MAX_FLASH_BANKS_DETECT
+# define CFI_MAX_FLASH_BANKS   CONFIG_SYS_MAX_FLASH_BANKS_DETECT
+#else
+# define CFI_MAX_FLASH_BANKS   CONFIG_SYS_MAX_FLASH_BANKS
+#endif
+
 extern flash_info_t flash_info[];
 
-static struct mtd_info cfi_mtd_info[CONFIG_SYS_MAX_FLASH_BANKS];
-static char cfi_mtd_names[CONFIG_SYS_MAX_FLASH_BANKS][16];
+static struct mtd_info cfi_mtd_info[CFI_MAX_FLASH_BANKS];
+static char cfi_mtd_names[CFI_MAX_FLASH_BANKS][16];
 #ifdef CONFIG_MTD_CONCAT
 static char c_mtd_name[16];
 #endif