From 44549d62c31dc433366b4c5d6e58e0e3091e542b Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sun, 26 Nov 2017 14:05:23 +0100 Subject: 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 Reviewed-by: Simon Glass Signed-off-by: Heinrich Schuchardt Signed-off-by: Alexander Graf --- lib/efi_loader/efi_net.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/efi_loader/efi_net.c') diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c index 74a67c5365d..8c5d5b492ca 100644 --- a/lib/efi_loader/efi_net.c +++ b/lib/efi_loader/efi_net.c @@ -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) -- cgit v1.2.3