All of lore.kernel.org
 help / color / mirror / Atom feed
From: Valeriy Glushkov <gvv@lstec.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] nand: Fixed invalid pointers to static relocated chip names
Date: Mon, 19 Jan 2009 16:32:59 +0200	[thread overview]
Message-ID: <12323755793336-git-send-email-gvv@lstec.com> (raw)
In-Reply-To: <20090119132940.5000D832E425@gemini.denx.de>

Dear Wolfgang,

You are right, the patch was ugly.
The new one seems to be better.

Signed-off-by: Valeriy Glushkov <gvv@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

  reply	other threads:[~2009-01-19 14:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-19 13:19 [U-Boot] [PATCH] NAND: cmd_nand.c: fix invalid pointers to static relocated chip names Valeriy Glushkov
2009-01-19 13:29 ` Wolfgang Denk
2009-01-19 14:32   ` Valeriy Glushkov [this message]
2009-02-06 23:24     ` [U-Boot] [PATCH v2] nand: Fixed " Scott Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12323755793336-git-send-email-gvv@lstec.com \
    --to=gvv@lstec.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.