Patchwork [U-Boot,v3,1/3] ftsmc020: fix relocation

login
register
mail settings
Submitter Macpaul Lin
Date May 2, 2011, 8:17 a.m.
Message ID <1304324251-15293-1-git-send-email-macpaul@andestech.com>
Download mbox | patch
Permalink /patch/93606/
State Accepted
Commit f194f6ba5bebb13d2f3f90513d224b95c86ddc5f
Headers show

Comments

Macpaul Lin - May 2, 2011, 8:17 a.m.
Avoid relocation problem by fix global declaration.

Signed-off-by: Macpaul Lin <macpaul@andestech.com>
---
Changes for v2:
  - Remove assembly register offsets for support lowlevel_init.S.
  - The nested structure of register offsets has been rewrote.
  - Fix relocation related declaration.
Changes for v3:
  - Split this patch into 3 different patches according to Wolfgang's suggestion
   - Fix gloable declarations to avoid problem in relocation.
   - Un-nested the register structure.
   - Add missing definitions in header according to datasheet.

 drivers/mtd/ftsmc020.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
Wolfgang Denk - May 12, 2011, 9:43 p.m.
Dear Macpaul Lin,

In message <1304324251-15293-1-git-send-email-macpaul@andestech.com> you wrote:
> Avoid relocation problem by fix global declaration.
> 
> Signed-off-by: Macpaul Lin <macpaul@andestech.com>
> ---
> Changes for v2:
>   - Remove assembly register offsets for support lowlevel_init.S.
>   - The nested structure of register offsets has been rewrote.
>   - Fix relocation related declaration.
> Changes for v3:
>   - Split this patch into 3 different patches according to Wolfgang's suggestion
>    - Fix gloable declarations to avoid problem in relocation.
>    - Un-nested the register structure.
>    - Add missing definitions in header according to datasheet.
> 
>  drivers/mtd/ftsmc020.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/drivers/mtd/ftsmc020.c b/drivers/mtd/ftsmc020.c
index b027685..ddeb3a4 100644
--- a/drivers/mtd/ftsmc020.c
+++ b/drivers/mtd/ftsmc020.c
@@ -27,12 +27,10 @@  struct ftsmc020_config {
 	unsigned int	timing;
 };
 
-static struct ftsmc020_config config[] = CONFIG_SYS_FTSMC020_CONFIGS;
-
-static struct ftsmc020 *smc = (struct ftsmc020 *)CONFIG_FTSMC020_BASE;
-
 static void ftsmc020_setup_bank(unsigned int bank, struct ftsmc020_config *cfg)
 {
+	struct ftsmc020 *smc = (struct ftsmc020 *)CONFIG_FTSMC020_BASE;
+
 	if (bank > 3) {
 		printf("bank # %u invalid\n", bank);
 		return;
@@ -44,6 +42,7 @@  static void ftsmc020_setup_bank(unsigned int bank, struct ftsmc020_config *cfg)
 
 void ftsmc020_init(void)
 {
+	struct ftsmc020_config config[] = CONFIG_SYS_FTSMC020_CONFIGS;
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(config); i++)