summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Phillips <kim.phillips@freescale.com>2009-07-14 16:00:24 -0500
committerStefan Roese <sr@denx.de>2009-07-16 15:27:45 +0200
commit9578718c1b085cac73017d834001bc5cb0b2f73f (patch)
tree82a984e3b5b97edf856d4d6d4c5eccd409732420
parent7d4450a9773673052fcd7fdf0a4a88c089126ac1 (diff)
downloadu-boot-imx-9578718c1b085cac73017d834001bc5cb0b2f73f.zip
u-boot-imx-9578718c1b085cac73017d834001bc5cb0b2f73f.tar.gz
u-boot-imx-9578718c1b085cac73017d834001bc5cb0b2f73f.tar.bz2
mtd: cfi - if defined, use MAX_FLASH_BANKS_DETECT for static declarations
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>
-rw-r--r--drivers/mtd/cfi_mtd.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/mtd/cfi_mtd.c b/drivers/mtd/cfi_mtd.c
index c7e357b..34748dd 100644
--- a/drivers/mtd/cfi_mtd.c
+++ b/drivers/mtd/cfi_mtd.c
@@ -31,10 +31,17 @@
#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