diff options
| author | Michael Brown | 2025-03-23 19:06:15 +0100 |
|---|---|---|
| committer | Michael Brown | 2025-03-24 14:19:26 +0100 |
| commit | 9dd30f11f74722a43ed590df9f525e038d155283 (patch) | |
| tree | 936e026af6624356fe467017866cb1095647b1ba /src/interface/efi/efi_file.c | |
| parent | [efi] Use efi_open_by_child() for all by-child protocol opens (diff) | |
| download | ipxe-9dd30f11f74722a43ed590df9f525e038d155283.tar.gz ipxe-9dd30f11f74722a43ed590df9f525e038d155283.tar.xz ipxe-9dd30f11f74722a43ed590df9f525e038d155283.zip | |
[efi] Use efi_open_by_driver() for all by-driver protocol opens
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface/efi/efi_file.c')
| -rw-r--r-- | src/interface/efi/efi_file.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/interface/efi/efi_file.c b/src/interface/efi/efi_file.c index 48fccdbe1..f31f2fe3b 100644 --- a/src/interface/efi/efi_file.c +++ b/src/interface/efi/efi_file.c @@ -1169,11 +1169,8 @@ int efi_file_install ( EFI_HANDLE handle ) { * of calls to our DRIVER_STOP method when starting the EFI * shell. I have no idea why this is. */ - if ( ( efirc = bs->OpenProtocol ( handle, &efi_disk_io_protocol_guid, - &diskio.interface, efi_image_handle, - handle, - EFI_OPEN_PROTOCOL_BY_DRIVER ) ) != 0){ - rc = -EEFI ( efirc ); + if ( ( rc = efi_open_by_driver ( handle, &efi_disk_io_protocol_guid, + &diskio.interface ) ) != 0 ) { DBGC ( handle, "Could not open disk I/O protocol: %s\n", strerror ( rc ) ); DBGC_EFI_OPENERS ( handle, handle, &efi_disk_io_protocol_guid ); @@ -1199,8 +1196,7 @@ int efi_file_install ( EFI_HANDLE handle ) { efi_file_path_uninstall ( &efi_file_initrd ); err_initrd_install: err_initrd_claim: - bs->CloseProtocol ( handle, &efi_disk_io_protocol_guid, - efi_image_handle, handle ); + efi_close_by_driver ( handle, &efi_disk_io_protocol_guid ); err_open: bs->UninstallMultipleProtocolInterfaces ( handle, @@ -1228,8 +1224,7 @@ void efi_file_uninstall ( EFI_HANDLE handle ) { efi_file_path_uninstall ( &efi_file_initrd ); /* Close our own disk I/O protocol */ - bs->CloseProtocol ( handle, &efi_disk_io_protocol_guid, - efi_image_handle, handle ); + efi_close_by_driver ( handle, &efi_disk_io_protocol_guid ); /* We must install the file system protocol first, since * otherwise the EDK2 code will attempt to helpfully uninstall |
