summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-07-01 13:16:17 +0800
committerSonic Zhang <sonic.zhang@analog.com>2013-07-31 16:56:04 +0800
commit53086befe88cc345ecb802b8dee79337f3ece2c7 (patch)
tree7147bbbb5d5198b54c797dedb4e503aa7b929042
parent9868b1426315fc5ac4883b5267d5337b2dfcbd95 (diff)
blackfin: Fix using gd->baudrate before setting its value
Current code uses gd->baudrate before setting its value. Besides, I got below build warning which is introduced by commit ddb5c5be "blackfin: add baudrate to bdinfo". board.c:235:3: warning: passing argument 1 of 'simple_strtoul' makes pointer from integer without a cast [enabled by default] include/vsprintf.h:27:7: note: expected 'const char *' but argument is of type 'unsigned int' This patch ensures we get the baudrate setting before using it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
-rw-r--r--arch/blackfin/lib/board.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index 10223bdb79..17d1f468dd 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -67,6 +67,7 @@ static int display_banner(void)
static int init_baudrate(void)
{
gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE);
+ gd->bd->bi_baudrate = gd->baudrate;
return 0;
}
@@ -235,8 +236,6 @@ static int global_board_data_init(void)
bd->bi_sclk = get_sclk();
bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
- bd->bi_baudrate = (gd->baudrate > 0)
- ? simple_strtoul(gd->baudrate, NULL, 10) : CONFIG_BAUDRATE;
return 0;
}