diff mbox

[v3,5/6] autoboot: move CONFIG_SILENT_CONSOLE handling

Message ID 1467012184-3231-6-git-send-email-yamada.masahiro@socionext.com
State New
Headers show

Commit Message

Masahiro Yamada June 27, 2016, 7:23 a.m. UTC
Factor out the same code from the callees to the caller.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Reviewed-by: Stefan Roese <sr@denx.de>

Reviewed-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Heiko Schocher <hs@denx.de>

---

Changes in v3: None
Changes in v2:
  - Fix build error when CONFIG_SILENT_CONSOLE is enabled

 common/autoboot.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

-- 
1.9.1

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

Patch

diff --git a/common/autoboot.c b/common/autoboot.c
index eb31c88..fb13139 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -202,11 +202,6 @@  static int __abortboot(int bootdelay)
 	if (!abort)
 		debug_bootkeys("key timeout\n");
 
-#ifdef CONFIG_SILENT_CONSOLE
-	if (abort)
-		gd->flags &= ~GD_FLG_SILENT;
-#endif
-
 	return abort;
 }
 
@@ -263,18 +258,22 @@  static int __abortboot(int bootdelay)
 
 	putc('\n');
 
-#ifdef CONFIG_SILENT_CONSOLE
-	if (abort)
-		gd->flags &= ~GD_FLG_SILENT;
-#endif
-
 	return abort;
 }
 # endif	/* CONFIG_AUTOBOOT_KEYED */
 
 static int abortboot(int bootdelay)
 {
-	return __abortboot(bootdelay);
+	int abort;
+
+	abort = __abortboot(bootdelay);
+
+#ifdef CONFIG_SILENT_CONSOLE
+	if (abort)
+		gd->flags &= ~GD_FLG_SILENT;
+#endif
+
+	return abort;
 }
 
 static void process_fdt_options(const void *blob)