[PATCH 13/25] efi-stdio: Implement efi_console_putc() using efi_console_puts()

Sascha Hauer s.hauer at pengutronix.de
Mon Dec 13 13:08:53 PST 2021


The current efi_console_putc() implementation bypasses the special
character handling. Fix that by using efi_console_puts() for the
implemenation of efi_console_putc().

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/serial/efi-stdio.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/serial/efi-stdio.c b/drivers/serial/efi-stdio.c
index d99eca9d5e..d512cc3e01 100644
--- a/drivers/serial/efi-stdio.c
+++ b/drivers/serial/efi-stdio.c
@@ -160,17 +160,6 @@ static int efi_read_key(struct efi_console_priv *priv, bool wait)
 	return xlate_keypress(&kd.key);
 }
 
-static void efi_console_putc(struct console_device *cdev, char c)
-{
-	uint16_t str[2] = {};
-	struct efi_console_priv *priv = to_efi(cdev);
-	struct efi_simple_text_output_protocol *con_out = priv->out;
-
-	str[0] = c;
-
-	con_out->output_string(con_out, str);
-}
-
 static void clear_to_eol(struct efi_console_priv *priv)
 {
 	int pos = priv->out->mode->cursor_column;
@@ -352,6 +341,11 @@ static int efi_console_puts(struct console_device *cdev, const char *s,
 	return nbytes;
 }
 
+static void efi_console_putc(struct console_device *cdev, char c)
+{
+	efi_console_puts(cdev, &c, 1);
+}
+
 static int efi_console_tstc(struct console_device *cdev)
 {
 	struct efi_console_priv *priv = to_efi(cdev);
-- 
2.30.2




More information about the barebox mailing list