From 6bdc856bc9135db420196683501b4f201b30ae3a Mon Sep 17 00:00:00 2001
From: Manish Pandey <manish.pandey2@arm.com>
Date: Wed, 6 Mar 2024 16:52:57 +0000
Subject: [PATCH] fix(arm): move console flush/switch in common function

There are some CI configs which apply patch on the fly to test some
unusual test scenarios. After commit c864af989 there is one patch which
does not apply cleanly into arm_bl31_plat_runtime_setup().

To fix this issue move console flush/switch into the caller of this
function.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I4116044d53bef349a707c977cf26d1df65200045
---
 plat/arm/common/arm_bl31_setup.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/plat/arm/common/arm_bl31_setup.c b/plat/arm/common/arm_bl31_setup.c
index a643733ece..33043b7b1f 100644
--- a/plat/arm/common/arm_bl31_setup.c
+++ b/plat/arm/common/arm_bl31_setup.c
@@ -338,9 +338,6 @@ void arm_bl31_plat_runtime_setup(void)
 #if PLAT_RO_XLAT_TABLES
 	arm_xlat_make_tables_readonly();
 #endif
-
-	console_flush();
-	console_switch_state(CONSOLE_FLAG_RUNTIME);
 }
 
 #if RECLAIM_INIT_CODE
@@ -394,6 +391,9 @@ void __init bl31_platform_setup(void)
 void bl31_plat_runtime_setup(void)
 {
 	arm_bl31_plat_runtime_setup();
+
+	console_flush();
+	console_switch_state(CONSOLE_FLAG_RUNTIME);
 }
 
 /*******************************************************************************
-- 
GitLab