summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-01-24 22:36:45 +0300
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-01-27 20:32:00 +0300
commit15436faa46a9958b019aea22d24bc52eb1da15ff (patch)
tree9b328ecfe34acbe6036c619a2ea5e2d9885f137a /lib
parent23aa0502a4b9a60156809cd27baf7e9016d1be56 (diff)
downloadu-boot-15436faa46a9958b019aea22d24bc52eb1da15ff.tar.xz
efi_loader: don't use HandleProtocol
HandleProtocol() is deprecrated. According to the UEFI specification it should be implemented as a call to OpenProtocolInterface() with a hard coded agent handle. This implies that we would have to call CloseProtocolInterfaces() after usage with the same handle. Getting rid of an EFI_CALL() is also appreciated. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_boottime.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index e65ca6a4cb..ba28989f36 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -1949,6 +1949,7 @@ efi_status_t efi_load_image_from_path(bool boot_policy,
efi_uintn_t buffer_size;
uint64_t addr, pages;
const efi_guid_t *guid;
+ struct efi_handler *handler;
/* In case of failure nothing is returned */
*buffer = NULL;
@@ -1970,11 +1971,11 @@ efi_status_t efi_load_image_from_path(bool boot_policy,
}
if (ret != EFI_SUCCESS)
return EFI_NOT_FOUND;
- ret = EFI_CALL(efi_handle_protocol(device, guid,
- (void **)&load_file_protocol));
+ ret = efi_search_protocol(device, guid, &handler);
if (ret != EFI_SUCCESS)
return EFI_NOT_FOUND;
buffer_size = 0;
+ load_file_protocol = handler->protocol_interface;
ret = EFI_CALL(load_file_protocol->load_file(
load_file_protocol, rem, boot_policy,
&buffer_size, NULL));