diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2017-11-26 14:05:23 +0100 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2017-12-01 13:41:01 +0100 |
commit | 44549d62c31dc433366b4c5d6e58e0e3091e542b (patch) | |
tree | fd6e03452db855dcb3ac028fded769a2917d3393 /lib/efi_loader/efi_disk.c | |
parent | ea54ad59286efe7e600f3e189036fa96989eace4 (diff) | |
download | u-boot-44549d62c31dc433366b4c5d6e58e0e3091e542b.tar.gz |
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>
Diffstat (limited to 'lib/efi_loader/efi_disk.c')
-rw-r--r-- | lib/efi_loader/efi_disk.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c index af8db40e19..68ba2cf7b2 100644 --- a/lib/efi_loader/efi_disk.c +++ b/lib/efi_loader/efi_disk.c @@ -224,13 +224,11 @@ static void efi_disk_add_dev(const char *name, goto out_of_memory; /* Hook up to the device list */ - INIT_LIST_HEAD(&diskobj->parent.protocols); - list_add_tail(&diskobj->parent.link, &efi_obj_list); + efi_add_handle(&diskobj->parent); /* Fill in object data */ diskobj->dp = efi_dp_from_part(desc, part); diskobj->part = part; - diskobj->parent.handle = diskobj; ret = efi_add_protocol(diskobj->parent.handle, &efi_block_io_guid, &diskobj->ops); if (ret != EFI_SUCCESS) |