From: Alexander Holler Date: Sat, 18 Dec 2010 02:16:28 +0000 (+0000) Subject: nand: fix bug with multiple NAND devices if CONFIG_MTD_DEVICE is defined. X-Git-Tag: v2011.03-rc1~33 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7fab9dfffab3a662f6ef1967dcb90618fd28df3c;p=u-boot nand: fix bug with multiple NAND devices if CONFIG_MTD_DEVICE is defined. The variable i has to be static, otherwise it would be always zero. Signed-off-by: Alexander Holler --- diff --git a/drivers/mtd/nand/nand.c b/drivers/mtd/nand/nand.c index c0e068ab7d..d987f4c85c 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;