From patchwork Sat Dec 18 12:16:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Holler X-Patchwork-Id: 76065 X-Patchwork-Delegate: scottwood@freescale.com 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 9F943B7063 for ; Sat, 18 Dec 2010 23:16:46 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CF11228099; Sat, 18 Dec 2010 13:16:44 +0100 (CET) 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 UZ0IR9PyCyOG; Sat, 18 Dec 2010 13:16:44 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4D0A228090; Sat, 18 Dec 2010 13:16:42 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2147328090 for ; Sat, 18 Dec 2010 13:16:40 +0100 (CET) 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 1XOW+L-lbRoR for ; Sat, 18 Dec 2010 13:16:38 +0100 (CET) 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 mail.ahsoftware.de (h1047321.serverkompetenz.net [85.214.67.163]) by theia.denx.de (Postfix) with ESMTPS id 080992808D for ; Sat, 18 Dec 2010 13:16:36 +0100 (CET) Received: by mail.ahsoftware.de (Postfix, from userid 65534) id 48AFE9C14F; Sat, 18 Dec 2010 13:16:36 +0100 (CET) Received: from eiche.ahsoftware (p57B20F2F.dip0.t-ipconnect.de [87.178.15.47]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.ahsoftware.de (Postfix) with ESMTP id AE1F49C14E; Sat, 18 Dec 2010 13:16:33 +0100 (CET) Received: from beagle.ahsoftware (conradbt.ahsoftware [192.168.213.4]) by eiche.ahsoftware (Postfix) with ESMTP id E29703FC75; Sat, 18 Dec 2010 13:16:31 +0100 (CET) From: Alexander Holler To: u-boot@lists.denx.de Date: Sat, 18 Dec 2010 13:16:28 +0100 Message-Id: <1292674588-3771-1-git-send-email-holler@ahsoftware.de> X-Mailer: git-send-email 1.7.2.2 Subject: [U-Boot] [PATCH] nand: fix bug with multiple NAND devices if CONFIG_MTD_DEVICE is defined. 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The variable i has to be static, otherwise it would be always zero. Signed-off-by: Alexander Holler --- drivers/mtd/nand/nand.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/mtd/nand/nand.c b/drivers/mtd/nand/nand.c index c0e068a..d987f4c 100644 --- a/drivers/mtd/nand/nand.c +++ b/drivers/mtd/nand/nand.c @@ -43,7 +43,7 @@ static void nand_init_chip(struct mtd_info *mtd, struct nand_chip *nand, ulong base_addr) { int maxchips = CONFIG_SYS_NAND_MAX_CHIPS; - int __attribute__((unused)) i = 0; + static int __attribute__((unused)) i = 0; if (maxchips < 1) maxchips = 1;