1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 16:52:14 +02:00

efi_loader: helper function to add EFI object to list

To avoid duplicate coding provide a helper function that
initializes an EFI object and adds it to the EFI object
list.

efi_exit() is the only place where we dereference a handle
to obtain a protocol interface. Add a comment to the function.

Suggested-by: Alexander Graf <agraf@suse.de>
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:
Heinrich Schuchardt
2017-11-26 14:05:23 +01:00
committed by Alexander Graf
parent ea54ad5928
commit 44549d62c3
5 changed files with 38 additions and 16 deletions

View File

@@ -296,11 +296,9 @@ int efi_net_register(void)
goto out_of_memory;
/* Hook net up to the device list */
INIT_LIST_HEAD(&netobj->parent.protocols);
list_add_tail(&netobj->parent.link, &efi_obj_list);
efi_add_handle(&netobj->parent);
/* Fill in object data */
netobj->parent.handle = &netobj->net;
r = efi_add_protocol(netobj->parent.handle, &efi_net_guid,
&netobj->net);
if (r != EFI_SUCCESS)