From patchwork Tue Dec 7 10:19:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 74503 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 86BE4B70EC for ; Tue, 7 Dec 2010 21:19:30 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1CAC52819C; Tue, 7 Dec 2010 11:19:27 +0100 (CET) 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 miyPTSSQFw-S; Tue, 7 Dec 2010 11:19:26 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F31272816E; Tue, 7 Dec 2010 11:19:24 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 302412816E for ; Tue, 7 Dec 2010 11:19:22 +0100 (CET) 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 2HLjNPDRaTso for ; Tue, 7 Dec 2010 11:19:20 +0100 (CET) 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 mo-p05-ob.rzone.de (mo-p05-ob.rzone.de [81.169.146.181]) by theia.denx.de (Postfix) with ESMTPS id 082E628127 for ; Tue, 7 Dec 2010 11:19:17 +0100 (CET) X-RZG-AUTH: :IW0NeWC7b/q2i6W/qstXb1SBUuFnrGohavlCkce+Ub5QXMSOpHp3KRMmmumF X-RZG-CLASS-ID: mo05 Received: from quad.fritz.box (p57BD3F3C.dip.t-dialin.net [87.189.63.60]) by post.strato.de (jimi mo36) (RZmta 24.8) with ESMTP id x0572fmB7A2S4P ; Tue, 7 Dec 2010 11:19:07 +0100 (MET) From: Stefan Roese To: u-boot@lists.denx.de Date: Tue, 7 Dec 2010 11:19:01 +0100 Message-Id: <1291717141-21532-1-git-send-email-sr@denx.de> X-Mailer: git-send-email 1.7.3.3 Subject: [U-Boot] [PATCH] Fix "autostart" env variable handling 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 Patch 5a442c0a [boot cmds: convert to getenv_yesno() with autostart] changes the boot commands code to use the getenv_yesno() helper function. But this function returns true (1) when "autostart" is not defined at all. This patch changes the logic of getenv_yesno() to only return true when "autostart" is defined and the first char is set to "y". This restores the old behavior on boards where "autostart" is not defined at all. Signed-off-by: Stefan Roese Cc: Mike Frysinger --- common/image.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/common/image.c b/common/image.c index f63a2ff..aa95882 100644 --- a/common/image.c +++ b/common/image.c @@ -412,7 +412,7 @@ static const image_header_t *image_get_ramdisk (ulong rd_addr, uint8_t arch, int getenv_yesno (char *var) { char *s = getenv (var); - return (s && (*s == 'n')) ? 0 : 1; + return (s && (*s == 'y')) ? 1 : 0; } ulong getenv_bootm_low(void)