As the system table already has pointers to the Simple Text Intput and
Output Protocols we can directly use these instead of calling
OpenProtocol.

Signed-off-by: Heinrich Schuchardt <heinrich.schucha...@canonical.com>
---
 cmd/eficonfig.c | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c
index e08b6ba4a5d..0a523ae10c7 100644
--- a/cmd/eficonfig.c
+++ b/cmd/eficonfig.c
@@ -2287,22 +2287,8 @@ static efi_status_t eficonfig_init(void)
        unsigned long columns, rows;
 
        if (!init) {
-               ret = efi_search_protocol(efi_root, 
&efi_guid_text_input_protocol, &handler);
-               if (ret != EFI_SUCCESS)
-                       return ret;
-
-               ret = efi_protocol_open(handler, (void **)&cin, efi_root, NULL,
-                                       EFI_OPEN_PROTOCOL_GET_PROTOCOL);
-               if (ret != EFI_SUCCESS)
-                       return ret;
-               ret = efi_search_protocol(efi_root, 
&efi_guid_text_output_protocol, &handler);
-               if (ret != EFI_SUCCESS)
-                       return ret;
-
-               ret = efi_protocol_open(handler, (void **)&cout, efi_root, NULL,
-                                       EFI_OPEN_PROTOCOL_GET_PROTOCOL);
-               if (ret != EFI_SUCCESS)
-                       return ret;
+               cout = systab.con_out;
+               cin = systab.con_in;
 
                cout->query_mode(cout, cout->mode->mode, &columns, &rows);
                avail_row = rows - (EFICONFIG_MENU_HEADER_ROW_NUM +
-- 
2.47.1

Reply via email to