]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mtd: cfi_flash: Use CONFIG_SYS_MONITOR_BASE only when defined
authorVignesh Raghavendra <vigneshr@ti.com>
Wed, 23 Oct 2019 08:00:00 +0000 (13:30 +0530)
committerStefan Roese <sr@denx.de>
Thu, 24 Oct 2019 07:48:53 +0000 (09:48 +0200)
Make use of CONFIG_SYS_MONITOR_BASE only when available to avoid build
error when CONFIG_SYS_MONITOR_BASE is not defined.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Stefan Roese <sr@denx.de>
drivers/mtd/cfi_flash.c

index c59254c76e3e19c2ec8bfd5ecfc05d57751e33b3..0574fa63a44d2579a87f1ef0186accbb921568db 100644 (file)
@@ -178,7 +178,8 @@ __maybe_weak u64 flash_read64(void *addr)
 /*-----------------------------------------------------------------------
  */
 #if defined(CONFIG_ENV_IS_IN_FLASH) || defined(CONFIG_ENV_ADDR_REDUND) || \
-       (CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE)
+       (defined(CONFIG_SYS_MONITOR_BASE) && \
+       (CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE))
 static flash_info_t *flash_get_info(ulong base)
 {
        int i;
@@ -2329,7 +2330,8 @@ static void flash_protect_default(void)
 #endif
 
        /* Monitor protection ON by default */
-#if (CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE) && \
+#if defined(CONFIG_SYS_MONITOR_BASE) && \
+       (CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE) && \
        (!defined(CONFIG_MONITOR_IS_IN_RAM))
        flash_protect(FLAG_PROTECT_SET,
                      CONFIG_SYS_MONITOR_BASE,