summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-10-07 17:21:28 +0300
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-10-10 17:34:26 +0300
commit731ab362d5b1d95e4716a4cde53e0434922f483f (patch)
treefc787a1100b563a528df289e459d01dbc3288184 /lib
parent7605c927219d82b40042c83f229676b14342ef6b (diff)
downloadu-boot-731ab362d5b1d95e4716a4cde53e0434922f483f.tar.xz
efi_loader: simplify efi_set_load_options()
* Replace the OpenProtocol() call by efi_search_protocol(). * Remove the CloseProtocol() call. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_load_options.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/efi_loader/efi_load_options.c b/lib/efi_loader/efi_load_options.c
index 71454f0fc6..3cfddee014 100644
--- a/lib/efi_loader/efi_load_options.c
+++ b/lib/efi_loader/efi_load_options.c
@@ -27,23 +27,18 @@ efi_status_t efi_set_load_options(efi_handle_t handle,
void *load_options)
{
struct efi_loaded_image *loaded_image_info;
+ struct efi_handler *handler;
efi_status_t ret;
- ret = EFI_CALL(systab.boottime->open_protocol(
- handle,
- &efi_guid_loaded_image,
- (void **)&loaded_image_info,
- efi_root, NULL,
- EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL));
+ ret = efi_search_protocol(handle, &efi_guid_loaded_image, &handler);
+ loaded_image_info = handler->protocol_interface;
if (ret != EFI_SUCCESS)
return EFI_INVALID_PARAMETER;
loaded_image_info->load_options = load_options;
loaded_image_info->load_options_size = load_options_size;
- return EFI_CALL(systab.boottime->close_protocol(handle,
- &efi_guid_loaded_image,
- efi_root, NULL));
+ return EFI_SUCCESS;
}
/**