From patchwork Fri May 17 06:35:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 244506 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 6913D2C0092 for ; Fri, 17 May 2013 16:36:24 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id ECBC84A036; Fri, 17 May 2013 08:36:20 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EQdDM6Sp-1H5; Fri, 17 May 2013 08:36:19 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CE2714A02C; Fri, 17 May 2013 08:36:18 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0D9AA4A02C for ; Fri, 17 May 2013 08:36:12 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id l+U6Z1EYdUZT for ; Fri, 17 May 2013 08:36:05 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtp.mei.co.jp (smtp.mei.co.jp [133.183.100.20]) by theia.denx.de (Postfix) with ESMTP id 186D04A025 for ; Fri, 17 May 2013 08:35:58 +0200 (CEST) Received: from mail-gw.jp.panasonic.com ([157.8.1.157]) by smtp.mei.co.jp (8.12.11.20060614/3.7W/kc-maile13) with ESMTP id r4H6Ztv3018981 for ; Fri, 17 May 2013 15:35:55 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili16) with ESMTP id r4H6ZtL30855 for ; Fri, 17 May 2013 15:35:55 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi12) id r4H6Zt9k032552; Fri, 17 May 2013 15:35:55 +0900 Received: from poodle by lomi12.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id r4H6Ztjb032492; Fri, 17 May 2013 15:35:55 +0900 Received: from beagle.diag.org (beagle.diag.org [10.186.51.83]) by poodle (Postfix) with ESMTP id 357A42740045; Fri, 17 May 2013 15:35:55 +0900 (JST) From: Masahiro Yamada To: u-boot@lists.denx.de Date: Fri, 17 May 2013 15:35:52 +0900 Message-Id: <1368772552-12784-1-git-send-email-yamada.m@jp.panasonic.com> X-Mailer: git-send-email 1.7.9.5 Subject: [U-Boot] [PATCH] cfi_flash: use CFI driver without a monitor program X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de When CONFIG_SYS_MONITOR_BASE is not defined and CONFIG_SYS_FLASH_BASE is defined as zero, compile failed with an error. We can work around this problem by defining CONFIG_SYS_MONITOR_BASE as any value even though a monitor program is not used. But this is not a correct way. Using CFI driver should not depend on the use of a monitor program. So, this commit corrects the build error by adding "if defined(CONFIG_SYS_MONITOR_BASE)" condition. Signed-off-by: Masahiro Yamada --- drivers/mtd/cfi_flash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index 22d8440..e418c22 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -2308,7 +2308,8 @@ 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,