summaryrefslogtreecommitdiff
path: root/common/main.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2013-05-15 06:23:55 +0000
committerTom Rini <trini@ti.com>2013-06-04 16:06:31 -0400
commit063ae006aedf1f828d8e23177eb8e049ce4fe968 (patch)
tree2a6dc25f96c67b37b096e29714e675f0ec61dda9 /common/main.c
parentea5427e2607041f6f5cf0bff8f5c85bc7f67dbf8 (diff)
downloadu-boot-imx-063ae006aedf1f828d8e23177eb8e049ce4fe968.zip
u-boot-imx-063ae006aedf1f828d8e23177eb8e049ce4fe968.tar.gz
u-boot-imx-063ae006aedf1f828d8e23177eb8e049ce4fe968.tar.bz2
main: Separate out the two abortboot() functions
There are two implementations of abortboot(). Turn these into two separate functions, and create a single abortboot() which calls either one or the other. Also it seems that nothing uses abortboot() outside main, so make it static. At this point there is no further use of CONFIG_MENU in main.c. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'common/main.c')
-rw-r--r--common/main.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/common/main.c b/common/main.c
index 9890184..22ea8fd 100644
--- a/common/main.c
+++ b/common/main.c
@@ -89,10 +89,7 @@ extern void mdm_init(void); /* defined in board.c */
*/
#if defined(CONFIG_BOOTDELAY)
# if defined(CONFIG_AUTOBOOT_KEYED)
-#ifndef CONFIG_MENU
-static inline
-#endif
-int abortboot(int bootdelay)
+static int abortboot_keyed(int bootdelay)
{
int abort = 0;
uint64_t etime = endtick(bootdelay);
@@ -211,10 +208,7 @@ int abortboot(int bootdelay)
static int menukey = 0;
#endif
-#ifndef CONFIG_MENU
-static inline
-#endif
-int abortboot(int bootdelay)
+static int abortboot_normal(int bootdelay)
{
int abort = 0;
unsigned long ts;
@@ -271,6 +265,15 @@ int abortboot(int bootdelay)
return abort;
}
# endif /* CONFIG_AUTOBOOT_KEYED */
+
+static int abortboot(int bootdelay)
+{
+#ifdef CONFIG_AUTOBOOT_KEYED
+ return abortboot_keyed(bootdelay);
+#else
+ return abortboot_normal(bootdelay);
+#endif
+}
#endif /* CONFIG_BOOTDELAY */
/*