Răsfoiți Sursa

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 <holler@ahsoftware.de>
Alexander Holler 14 ani în urmă
părinte
comite
7fab9dfffa
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      drivers/mtd/nand/nand.c

+ 1 - 1
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;