mirror of
https://xff.cz/git/u-boot/
synced 2025-09-02 17:22:22 +02:00
efi_loader: simplify find_obj
Use function efi_search_protocol(). Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
committed by
Alexander Graf
parent
80286e8f81
commit
72292aba4f
@@ -128,18 +128,14 @@ static struct efi_object *find_obj(struct efi_device_path *dp, bool short_path,
|
|||||||
struct efi_object *efiobj;
|
struct efi_object *efiobj;
|
||||||
|
|
||||||
list_for_each_entry(efiobj, &efi_obj_list, link) {
|
list_for_each_entry(efiobj, &efi_obj_list, link) {
|
||||||
int i;
|
struct efi_handler *handler;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(efiobj->protocols); i++) {
|
|
||||||
struct efi_handler *handler = &efiobj->protocols[i];
|
|
||||||
struct efi_device_path *obj_dp;
|
struct efi_device_path *obj_dp;
|
||||||
|
efi_status_t ret;
|
||||||
|
|
||||||
if (!handler->guid)
|
ret = efi_search_protocol(efiobj->handle,
|
||||||
break;
|
&efi_guid_device_path, &handler);
|
||||||
|
if (ret != EFI_SUCCESS)
|
||||||
if (guidcmp(handler->guid, &efi_guid_device_path))
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
obj_dp = handler->protocol_interface;
|
obj_dp = handler->protocol_interface;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@@ -154,7 +150,6 @@ static struct efi_object *find_obj(struct efi_device_path *dp, bool short_path,
|
|||||||
obj_dp = shorten_path(efi_dp_next(obj_dp));
|
obj_dp = shorten_path(efi_dp_next(obj_dp));
|
||||||
} while (short_path && obj_dp);
|
} while (short_path && obj_dp);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user