public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] blackfin: Fix using gd->baudrate before setting its value
@ 2013-06-29  0:34 Axel Lin
  2013-06-29  8:26 ` Marek Vasut
  2013-07-01  3:45 ` Sonic Zhang
  0 siblings, 2 replies; 6+ messages in thread
From: Axel Lin @ 2013-06-29  0:34 UTC (permalink / raw)
  To: u-boot

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 moves the code using gd->baudrate to be after init_baudrate() call,
this ensures we get the baudrate setting before using it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
I forgot to CC u-boot mail list. here is a resend.

Hi,
I don't have this hardware to test.
I'd appreciate if someone can test it.

Thanks,
Axel
 arch/blackfin/lib/board.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index f1d5547..9e2e9de 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -231,8 +231,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;
 }
@@ -299,6 +297,7 @@ void board_init_f(ulong bootflag)
 	env_init();
 	serial_early_puts("Baudrate init\n");
 	init_baudrate();
+	gd->bd->bi_baudrate = gd->baudrate;
 	serial_early_puts("Serial init\n");
 	serial_init();
 	serial_initialize();
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-07-01  4:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-29  0:34 [U-Boot] [PATCH] blackfin: Fix using gd->baudrate before setting its value Axel Lin
2013-06-29  8:26 ` Marek Vasut
2013-06-29  8:49   ` Axel Lin
2013-07-01  3:45 ` Sonic Zhang
2013-07-01  4:11   ` Axel Lin
2013-07-01  4:49     ` Sonic Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox