]> git.sur5r.net Git - u-boot/blobdiff - drivers/mtd/nand/nand.c
Merge branch 'master' of git://git.denx.de/u-boot-mips
[u-boot] / drivers / mtd / nand / nand.c
index d3691151f0513eb3c613d43dc29bbcf1ad4a7ab4..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;
@@ -54,10 +54,12 @@ static void nand_init_chip(struct mtd_info *mtd, struct nand_chip *nand,
                if (nand_scan(mtd, maxchips) == 0) {
                        if (!mtd->name)
                                mtd->name = (char *)default_nand_name;
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
                        else
                                mtd->name += gd->reloc_off;
+#endif
 
-#ifdef CONFIG_MTD_PARTITIONS
+#ifdef CONFIG_MTD_DEVICE
                        /*
                         * Add MTD device so that we can reference it later
                         * via the mtdcore infrastructure (e.g. ubi).