summaryrefslogtreecommitdiff
path: root/lib/efi_loader
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-04-04 08:17:48 +0300
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-04-08 08:45:34 +0300
commitff6ce8da978bbcf283e34c07406085af2359f7b0 (patch)
tree9ecd566e238bc8ff2b2062aec0c0d535fb48073f /lib/efi_loader
parent5eed4a1ed7849bf651e4628538e9dab3a5e91fbc (diff)
downloadu-boot-ff6ce8da978bbcf283e34c07406085af2359f7b0.tar.xz
efi_loader: avoid using HandleProtocol in helloworld.efi
HandleProtocol() is deprecated and leaves an OpenedProtocolInformation behind. Use OpenProtocol(GET_PROTOCOL) instead. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'lib/efi_loader')
-rw-r--r--lib/efi_loader/helloworld.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/efi_loader/helloworld.c b/lib/efi_loader/helloworld.c
index 49fa8cc2f0..6405f58ec3 100644
--- a/lib/efi_loader/helloworld.c
+++ b/lib/efi_loader/helloworld.c
@@ -197,8 +197,10 @@ efi_status_t EFIAPI efi_main(efi_handle_t handle,
print_config_tables();
/* Get the loaded image protocol */
- ret = boottime->handle_protocol(handle, &loaded_image_guid,
- (void **)&loaded_image);
+ ret = boottime->open_protocol(handle, &loaded_image_guid,
+ (void **)&loaded_image, NULL, NULL,
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL);
+
if (ret != EFI_SUCCESS) {
con_out->output_string
(con_out, u"Cannot open loaded image protocol\r\n");
@@ -219,9 +221,10 @@ efi_status_t EFIAPI efi_main(efi_handle_t handle,
(con_out, u"Missing device handle\r\n");
goto out;
}
- ret = boottime->handle_protocol(loaded_image->device_handle,
- &device_path_guid,
- (void **)&device_path);
+ ret = boottime->open_protocol(loaded_image->device_handle,
+ &device_path_guid,
+ (void **)&device_path, NULL, NULL,
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (ret != EFI_SUCCESS) {
con_out->output_string
(con_out, u"Missing device path for device handle\r\n");