From patchwork Wed Apr 13 19:32:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Fleming X-Patchwork-Id: 91084 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 52A78B6FCE for ; Thu, 14 Apr 2011 05:32:55 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 724C22827C; Wed, 13 Apr 2011 21:32:53 +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 4zibuT8fE2ZF; Wed, 13 Apr 2011 21:32:53 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 64B332827D; Wed, 13 Apr 2011 21:32:50 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 745532827D for ; Wed, 13 Apr 2011 21:32:48 +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 Avqnzc1-7dSm for ; Wed, 13 Apr 2011 21:32:47 +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 TX2EHSOBE008.bigfish.com (tx2ehsobe004.messaging.microsoft.com [65.55.88.14]) by theia.denx.de (Postfix) with ESMTPS id 07B0C2827C for ; Wed, 13 Apr 2011 21:32:45 +0200 (CEST) Received: from mail77-tx2-R.bigfish.com (10.9.14.253) by TX2EHSOBE008.bigfish.com (10.9.40.28) with Microsoft SMTP Server id 14.1.225.8; Wed, 13 Apr 2011 19:32:43 +0000 Received: from mail77-tx2 (localhost.localdomain [127.0.0.1]) by mail77-tx2-R.bigfish.com (Postfix) with ESMTP id C39D58E85D5; Wed, 13 Apr 2011 19:32:42 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail77-tx2 (localhost.localdomain [127.0.0.1]) by mail77-tx2 (MessageSwitch) id 1302723144728602_25979; Wed, 13 Apr 2011 19:32:24 +0000 (UTC) Received: from TX2EHSMHS006.bigfish.com (unknown [10.9.14.241]) by mail77-tx2.bigfish.com (Postfix) with ESMTP id 811C3A806B; Wed, 13 Apr 2011 19:32:24 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by TX2EHSMHS006.bigfish.com (10.9.99.106) with Microsoft SMTP Server (TLS) id 14.1.225.8; Wed, 13 Apr 2011 19:32:23 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.1.270.2; Wed, 13 Apr 2011 14:32:22 -0500 Received: from localhost (firefly.am.freescale.net [10.82.123.6]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p3DJWL8c017461; Wed, 13 Apr 2011 14:32:21 -0500 (CDT) From: Andy Fleming To: Date: Wed, 13 Apr 2011 14:32:21 -0500 Message-ID: <1302723141-8296-1-git-send-email-afleming@freescale.com> X-Mailer: git-send-email 1.6.5.2.g6ff9a MIME-Version: 1.0 X-OriginatorOrg: freescale.com Cc: ptyser@xes-inc.com, galak@kernel.crashing.org, u-boot@lists.denx.de Subject: [U-Boot] [PATCH] cfi_flash: Fix CONFIG_SYS_FLASH_AUTOPROTECT_LIST X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The patch which created flash_protect_default(), moved the autoprotect list code into that function, but left its variable declarations in the init function. Signed-off-by: Andy Fleming --- drivers/mtd/cfi_flash.c | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index 5788328..ff2450b 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -2089,6 +2089,14 @@ static void cfi_flash_set_config_reg(u32 base, u16 val) void flash_protect_default(void) { +#if defined(CONFIG_SYS_FLASH_AUTOPROTECT_LIST) + int i; + struct apl_s { + ulong start; + ulong size; + } apl[] = CONFIG_SYS_FLASH_AUTOPROTECT_LIST; +#endif + /* Monitor protection ON by default */ #if (CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE) && \ (!defined(CONFIG_MONITOR_IS_IN_RAM)) @@ -2130,13 +2138,6 @@ unsigned long flash_init (void) { unsigned long size = 0; int i; -#if defined(CONFIG_SYS_FLASH_AUTOPROTECT_LIST) - struct apl_s { - ulong start; - ulong size; - } apl[] = CONFIG_SYS_FLASH_AUTOPROTECT_LIST; -#endif - #ifdef CONFIG_SYS_FLASH_PROTECTION /* read environment from EEPROM */ char s[64];