From patchwork Mon Oct 24 09:46:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Macpaul Lin X-Patchwork-Id: 121312 X-Patchwork-Delegate: macpaul@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id CBE91B6F68 for ; Mon, 24 Oct 2011 20:46:53 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 072E1280AF; Mon, 24 Oct 2011 11:46:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mnMWu+llUXK7; Mon, 24 Oct 2011 11:46:50 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0762D28C87; Mon, 24 Oct 2011 11:46:48 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F2E9228C87 for ; Mon, 24 Oct 2011 11:46:45 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1a0+yjO9qsNQ for ; Mon, 24 Oct 2011 11:46:44 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from atces.andestech.com (59-124-160-118.HINET-IP.hinet.net [59.124.160.118]) by theia.denx.de (Postfix) with ESMTP id 416CB28C49 for ; Mon, 24 Oct 2011 11:46:42 +0200 (CEST) Received: from ATCPCS06.andestech.com (atcpcs06.andestech.com [10.0.1.236]) by atces.andestech.com (Postfix) with ESMTP id 66E1A2E20083; Mon, 24 Oct 2011 17:46:38 +0800 (CST) Received: from app01.andestech.com ([10.0.4.31]) by ATCPCS06.andestech.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 24 Oct 2011 17:46:38 +0800 From: Macpaul Lin To: u-boot@lists.denx.de, wd@denx.de, vapier@gentoo.org, macpaul@gmail.com, sjg@chromium.org, robotboy@chromium.org Date: Mon, 24 Oct 2011 17:46:31 +0800 Message-Id: <1319449593-2427-1-git-send-email-macpaul@andestech.com> X-Mailer: git-send-email 1.7.3.5 X-OriginalArrivalTime: 24 Oct 2011 09:46:38.0052 (UTC) FILETIME=[D3274240:01CC9231] Cc: Macpaul Lin Subject: [U-Boot] [PATCH 1/3] nds32: Use getenv_ulong() in place of getenv(), strtoul X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This changes the board code to use the new getenv_ulong() function. Signed-off-by: Macpaul Lin --- 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");