From: Alexander Holler Date: Sat, 18 Dec 2010 13:16:28 +0100 Subject: [U-Boot] [PATCH] nand: fix bug with multiple NAND devices if CONFIG_MTD_DEVICE is defined. Message-ID: <1292674588-3771-1-git-send-email-holler@ahsoftware.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@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; -- 1.7.2.2