[U-Boot] [PATCH v2] nand: Fixed invalid pointers to static relocated chip names
Valeriy Glushkov
gvv at lstec.com
Mon Jan 19 15:32:59 CET 2009
Dear Wolfgang,
You are right, the patch was ugly.
The new one seems to be better.
Signed-off-by: Valeriy Glushkov <gvv at lstec.com>
---
diff --git a/drivers/mtd/nand/nand.c b/drivers/mtd/nand/nand.c
index 700d21d..8ac53e0 100644
--- a/drivers/mtd/nand/nand.c
+++ b/drivers/mtd/nand/nand.c
@@ -28,6 +28,8 @@
#define CFG_NAND_BASE_LIST { CFG_NAND_BASE }
#endif
+DECLARE_GLOBAL_DATA_PTR;
+
int nand_curr_device = -1;
nand_info_t nand_info[CFG_MAX_NAND_DEVICE];
@@ -48,6 +50,8 @@ static void nand_init_chip(struct mtd_info *mtd, struct nand_chip *nand,
if (nand_scan(mtd, 1) == 0) {
if (!mtd->name)
mtd->name = (char *)default_nand_name;
+ else
+ mtd->name += gd->reloc_off;
} else
mtd->name = NULL;
} else {
--
1.5.2.5
More information about the U-Boot
mailing list