nand: fix bug with multiple NAND devices if CONFIG_MTD_DEVICE is defined.
authorAlexander Holler <holler@ahsoftware.de>
Sat, 18 Dec 2010 02:16:28 +0000 (02:16 +0000)
committerScott Wood <scottwood@freescale.com>
Wed, 12 Jan 2011 23:13:10 +0000 (17:13 -0600)
The variable i has to be static, otherwise it would be always zero.

Signed-off-by: Alexander Holler <holler@ahsoftware.de>
drivers/mtd/nand/nand.c

index c0e068ab7d5f9c08973961055242a4bb581798cd..d987f4c85c83539fe47ecf82b23650c1f8dbfab9 100644 (file)
@@ -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;