All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] nds32: Use getenv_ulong() in place of getenv(), strtoul
@ 2011-10-24  9:46 Macpaul Lin
  2011-10-24  9:46 ` [U-Boot] [PATCH 2/3] nds32: cache: define ARCH_DMA_MINALIGN for DMA buffer alignment Macpaul Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Macpaul Lin @ 2011-10-24  9:46 UTC (permalink / raw)
  To: u-boot

This changes the board code to use the new getenv_ulong() function.

Signed-off-by: Macpaul Lin <macpaul@andestech.com>
---
 arch/nds32/lib/board.c |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c
index 1776a72..2fd0e93 100644
--- a/arch/nds32/lib/board.c
+++ b/arch/nds32/lib/board.c
@@ -50,13 +50,7 @@ ulong monitor_flash_len;
 #endif
 static int init_baudrate(void)
 {
-	char tmp[64];	/* long enough for environment variables */
-	int i = getenv_f("baudrate", tmp, sizeof(tmp));
-
-	gd->bd->bi_baudrate = gd->baudrate = (i > 0)
-			? (int) simple_strtoul(tmp, NULL, 10)
-			: CONFIG_BAUDRATE;
-
+	gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE);
 	return 0;
 }
 
@@ -400,9 +394,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
 #endif
 
 	/* Initialize from environment */
-	s = getenv("loadaddr");
-	if (s != NULL)
-		load_addr = simple_strtoul(s, NULL, 16);
+	load_addr = getenv_ulong("loadaddr", 16, load_addr);
 
 #if defined(CONFIG_CMD_NET)
 	s = getenv("bootfile");
-- 
1.7.3.5

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

end of thread, other threads:[~2011-11-01  4:37 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-24  9:46 [U-Boot] [PATCH 1/3] nds32: Use getenv_ulong() in place of getenv(), strtoul Macpaul Lin
2011-10-24  9:46 ` [U-Boot] [PATCH 2/3] nds32: cache: define ARCH_DMA_MINALIGN for DMA buffer alignment Macpaul Lin
2011-10-24 17:16   ` Anton Staaf
2011-10-28  4:46     ` 馬克泡
2011-10-31  0:40       ` Mike Frysinger
2011-11-01  3:28         ` 馬克泡
2011-11-01  4:35     ` 馬克泡
2011-10-24  9:46 ` [U-Boot] [PATCH 3/3] nds32: asm/io.h: add __iormb and __iowmb support Macpaul Lin
2011-10-24 13:38   ` Marek Vasut
2011-10-24 13:50     ` 馬克泡
2011-10-25  8:20       ` 馬克泡
2011-10-25  8:29         ` Marek Vasut
2011-10-25 10:16           ` 馬克泡
2011-10-26  5:19             ` 馬克泡
2011-10-26  5:55               ` Graeme Russ
2011-10-27  3:23                 ` 馬克泡
2011-10-27  3:39                   ` Graeme Russ
2011-10-25 11:03           ` [U-Boot] [PATCH v2] nds32: asm/io.h: add __iormb __iowmb and inline io support Macpaul Lin
2011-11-01  4:37             ` 馬克泡
2011-11-01  4:33 ` [U-Boot] [PATCH 1/3] nds32: Use getenv_ulong() in place of getenv(), strtoul 馬克泡

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.