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

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

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to