cfi_flash: Remove uneccessary #ifdef CONFIG_SYS_MAX_FLASH_BANKS_DETECT
authorStefan Roese <sr@denx.de>
Tue, 31 Aug 2010 08:04:11 +0000 (10:04 +0200)
committerStefan Roese <sr@denx.de>
Mon, 20 Sep 2010 13:09:00 +0000 (15:09 +0200)
Now that the defines are moved to header files we don't need this
conditional compilation any more. Remove it.

Signed-off-by: Stefan Roese <sr@denx.de>
common/cmd_flash.c
drivers/mtd/cfi_mtd.c

index ff43965e9c0939ecca44f4bba73fa63788b705b6..2a02eb90d4c0160c3faeb13084ceeb1f67a2fc91 100644 (file)
@@ -42,6 +42,8 @@ int find_dev_and_part(const char *id, struct mtd_device **dev,
 #endif
 
 #ifndef CONFIG_SYS_NO_FLASH
+#include <flash.h>
+#include <mtd/cfi_flash.h>
 extern flash_info_t flash_info[];      /* info for FLASH chips */
 
 /*
@@ -417,11 +419,7 @@ int flash_sect_erase (ulong addr_first, ulong addr_last)
 {
        flash_info_t *info;
        ulong bank;
-#ifdef CONFIG_SYS_MAX_FLASH_BANKS_DETECT
-       int s_first[CONFIG_SYS_MAX_FLASH_BANKS_DETECT], s_last[CONFIG_SYS_MAX_FLASH_BANKS_DETECT];
-#else
        int s_first[CONFIG_SYS_MAX_FLASH_BANKS], s_last[CONFIG_SYS_MAX_FLASH_BANKS];
-#endif
        int erased = 0;
        int planned;
        int rcode = 0;
@@ -635,11 +633,7 @@ int flash_sect_protect (int p, ulong addr_first, ulong addr_last)
 {
        flash_info_t *info;
        ulong bank;
-#ifdef CONFIG_SYS_MAX_FLASH_BANKS_DETECT
-       int s_first[CONFIG_SYS_MAX_FLASH_BANKS_DETECT], s_last[CONFIG_SYS_MAX_FLASH_BANKS_DETECT];
-#else
        int s_first[CONFIG_SYS_MAX_FLASH_BANKS], s_last[CONFIG_SYS_MAX_FLASH_BANKS];
-#endif
        int protected, i;
        int planned;
        int rcode;
index 6a0cab3059ba2b0976afa3e6ca85b50c3ed9bc87..cbcc165c7efd4df7fcbfbf4135f8427e337628ad 100644 (file)
 #include <asm/errno.h>
 #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[];
+#include <mtd/cfi_flash.h>
 
 static struct mtd_info cfi_mtd_info[CFI_MAX_FLASH_BANKS];
 static char cfi_mtd_names[CFI_MAX_FLASH_BANKS][16];