All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] bootdelay can be an environemt variable
@ 2010-04-27  6:13 Matthias Weisser
  2010-04-27  8:19 ` Wolfgang Denk
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias Weisser @ 2010-04-27  6:13 UTC (permalink / raw)
  To: u-boot

This patch allows the bootdelay variable contain the name of
another variable holding the actual bootdelay value.

Signed-off-by: Matthias Weisser <weisserm@arcor.de>
---
 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

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

end of thread, other threads:[~2010-04-27 10:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-27  6:13 [U-Boot] [PATCH] bootdelay can be an environemt variable Matthias Weisser
2010-04-27  8:19 ` Wolfgang Denk
2010-04-27  9:31   ` Matthias Weißer
2010-04-27 10:24     ` Wolfgang Denk

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.