cmd: simplify eficonfig_init()
As the system table already has pointers to the Simple Text Input and
Output Protocols we can directly use these instead of calling
OpenProtocol.
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c
index e08b6ba..629bf1b 100644
--- a/cmd/eficonfig.c
+++ b/cmd/eficonfig.c
@@ -2283,26 +2283,11 @@
{
efi_status_t ret = EFI_SUCCESS;
static bool init;
- struct efi_handler *handler;
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 +