summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_load_initrd.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-10-16 20:23:47 -0400
committerTom Rini <trini@konsulko.com>2022-10-16 20:23:47 -0400
commite2ff1d0fa777b11ad6b26432cb7613ab433b15d6 (patch)
tree905752b31d7b4161ed2f166b3d1ab0d98c07333c /lib/efi_loader/efi_load_initrd.c
parent0e49f5c26caf9972137a474065afd4bdfe5ec062 (diff)
parent70089c13a73f58315547982573be2016e7a70958 (diff)
Merge tag 'efi-2023-01-rc1-3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request for efi-2023-01-rc1-3 UEFI: * replace EFI_CALL() by internal functions * delete loadfile2 handle by uninstalling all protocols Other: * Provide spi_set_speed() needed for implementation of EFI SPI I/O protocol
Diffstat (limited to 'lib/efi_loader/efi_load_initrd.c')
-rw-r--r--lib/efi_loader/efi_load_initrd.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/efi_loader/efi_load_initrd.c b/lib/efi_loader/efi_load_initrd.c
index 87fde3f88c2..193433782c2 100644
--- a/lib/efi_loader/efi_load_initrd.c
+++ b/lib/efi_loader/efi_load_initrd.c
@@ -213,7 +213,7 @@ efi_status_t efi_initrd_register(void)
&efi_guid_device_path, &dp_lf2_handle,
/* LOAD_FILE2 */
&efi_guid_load_file2_protocol,
- (void *)&efi_lf2_protocol,
+ &efi_lf2_protocol,
NULL);
return ret;
@@ -227,11 +227,22 @@ efi_status_t efi_initrd_register(void)
*
* Return: status code
*/
-void efi_initrd_deregister(void)
+efi_status_t efi_initrd_deregister(void)
{
+ efi_status_t ret;
+
if (!efi_initrd_handle)
- return;
+ return EFI_SUCCESS;
- efi_delete_handle(efi_initrd_handle);
+ ret = efi_uninstall_multiple_protocol_interfaces(efi_initrd_handle,
+ /* initramfs */
+ &efi_guid_device_path,
+ &dp_lf2_handle,
+ /* LOAD_FILE2 */
+ &efi_guid_load_file2_protocol,
+ &efi_lf2_protocol,
+ NULL);
efi_initrd_handle = NULL;
+
+ return ret;
}