summaryrefslogtreecommitdiffstats
path: root/drivers/serial/efi-stdio.c
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2019-10-21 11:23:40 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-10-23 09:00:23 +0200
commita3b0c7f17290d86e261bd35211e8f322ac97e749 (patch)
treebc824162fe01d57496031bbe5a9bffcd42a4d5e8 /drivers/serial/efi-stdio.c
parentc64a4a4ccf9bc60385f9c3ba07886d7024503444 (diff)
downloadbarebox-a3b0c7f17290d86e261bd35211e8f322ac97e749.tar.gz
barebox-a3b0c7f17290d86e261bd35211e8f322ac97e749.tar.xz
serial: efi-stdio: replace globals with handles in priv struct
Despite assigning efi_sys_table->{con_in,con_out} to priv->{in,out}, some functions still use the global efi_sys_table->{con_in,con_out}. Let's restrict globals access to the probe function and have the priv struct completely describe input and output used in the callbacks. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/serial/efi-stdio.c')
-rw-r--r--drivers/serial/efi-stdio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/serial/efi-stdio.c b/drivers/serial/efi-stdio.c
index 2ca89fa4f8..a8cc967b32 100644
--- a/drivers/serial/efi-stdio.c
+++ b/drivers/serial/efi-stdio.c
@@ -116,7 +116,7 @@ static int efi_read_key(struct efi_console_priv *priv, bool wait)
if (wait)
BS->wait_for_event(1, priv->in->wait_for_key, &index);
- efiret = priv->in->read_key_stroke(efi_sys_table->con_in, &k);
+ efiret = priv->in->read_key_stroke(priv->in, &k);
if (EFI_ERROR(efiret))
return -efi_errno(efiret);
@@ -133,7 +133,8 @@ static int efi_read_key(struct efi_console_priv *priv, bool wait)
static void efi_console_putc(struct console_device *cdev, char c)
{
uint16_t str[2] = {};
- struct efi_simple_text_output_protocol *con_out = efi_sys_table->con_out;
+ struct efi_console_priv *priv = to_efi(cdev);
+ struct efi_simple_text_output_protocol *con_out = priv->out;
str[0] = c;