Skip to contentSkip to conversation

nand: fix bug with multiple NAND devices if CONFIG_MTD_DEVICE is defined.

PATCH New Alexander Holler 2 participants 2 messages Dec 18, 2010 – Jan 4, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/mtd/nand/nand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mtd/nand/nand.c +1 -1
index c0e068a..d987f4c 100644
@@ -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;
Signature · 1 line
1.7.2.2
#1 lore raw

PATCH 1/1 nand: fix bug with multiple NAND devices if CONFIG_MTD_DEVICE is defined.

Quoted 6 lines · Alexander Holler

The variable i has to be static, otherwise it would be always zero.

---
 drivers/mtd/nand/nand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied to u-boot-nand-flash.

-Scott