efi_stub: Move carriage return before line feed in putc()

A carriage return needs to execute before a line feed.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
diff --git a/lib/efi/efi_stub.c b/lib/efi/efi_stub.c
index e138709..8b4bb4e 100644
--- a/lib/efi/efi_stub.c
+++ b/lib/efi/efi_stub.c
@@ -65,6 +65,9 @@
 
 void putc(const char ch)
 {
+	if (ch == '\n')
+		putc('\r');
+
 	if (use_uart) {
 		NS16550_t com_port = (NS16550_t)0x3f8;
 
@@ -74,8 +77,6 @@
 	} else {
 		efi_putc(global_priv, ch);
 	}
-	if (ch == '\n')
-		putc('\r');
 }
 
 void puts(const char *str)