mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-17 22:49:02 +00:00
efi_loader: simplify efi_uninstall_protocol()
The call to efi_search_obj() is redundant as the function is called in efi_search_protocol() too. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
parent
5dcfc99b2b
commit
6287021ff9
1 changed files with 1 additions and 8 deletions
|
@ -1357,18 +1357,11 @@ static efi_status_t efi_uninstall_protocol
|
||||||
(efi_handle_t handle, const efi_guid_t *protocol,
|
(efi_handle_t handle, const efi_guid_t *protocol,
|
||||||
void *protocol_interface)
|
void *protocol_interface)
|
||||||
{
|
{
|
||||||
struct efi_object *efiobj;
|
|
||||||
struct efi_handler *handler;
|
struct efi_handler *handler;
|
||||||
struct efi_open_protocol_info_item *item;
|
struct efi_open_protocol_info_item *item;
|
||||||
struct efi_open_protocol_info_item *pos;
|
struct efi_open_protocol_info_item *pos;
|
||||||
efi_status_t r;
|
efi_status_t r;
|
||||||
|
|
||||||
/* Check handle */
|
|
||||||
efiobj = efi_search_obj(handle);
|
|
||||||
if (!efiobj) {
|
|
||||||
r = EFI_INVALID_PARAMETER;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
/* Find the protocol on the handle */
|
/* Find the protocol on the handle */
|
||||||
r = efi_search_protocol(handle, protocol, &handler);
|
r = efi_search_protocol(handle, protocol, &handler);
|
||||||
if (r != EFI_SUCCESS)
|
if (r != EFI_SUCCESS)
|
||||||
|
@ -1376,7 +1369,7 @@ static efi_status_t efi_uninstall_protocol
|
||||||
if (handler->protocol_interface != protocol_interface)
|
if (handler->protocol_interface != protocol_interface)
|
||||||
return EFI_NOT_FOUND;
|
return EFI_NOT_FOUND;
|
||||||
/* Disconnect controllers */
|
/* Disconnect controllers */
|
||||||
r = efi_disconnect_all_drivers(efiobj, protocol, NULL);
|
r = efi_disconnect_all_drivers(handle, protocol, NULL);
|
||||||
if (r != EFI_SUCCESS) {
|
if (r != EFI_SUCCESS) {
|
||||||
r = EFI_ACCESS_DENIED;
|
r = EFI_ACCESS_DENIED;
|
||||||
goto out;
|
goto out;
|
||||||
|
|
Loading…
Add table
Reference in a new issue