From: Matthias Weisser Date: Tue, 27 Apr 2010 08:13:54 +0200 Subject: [U-Boot] [PATCH] bootdelay can be an environemt variable Message-ID: <1272348834-30161-1-git-send-email-weisserm@arcor.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This patch allows the bootdelay variable contain the name of another variable holding the actual bootdelay value. Signed-off-by: Matthias Weisser --- common/main.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/common/main.c b/common/main.c index f7e7c1c..f43802c 100644 --- a/common/main.c +++ b/common/main.c @@ -371,7 +371,14 @@ void main_loop (void) #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0) s = getenv ("bootdelay"); - bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY; + if (s != NULL) { + char *v = getenv (s); + if (v != NULL) + bootdelay = (int)simple_strtol(v, NULL, 10); + else + bootdelay = (int)simple_strtol(s, NULL, 10); + } else + bootdelay = CONFIG_BOOTDELAY; debug ("### main_loop entered: bootdelay=%d\n\n", bootdelay); -- 1.5.6.3