aboutsummaryrefslogtreecommitdiff
path: root/lib/efi_driver/efi_block_device.c
diff options
context:
space:
mode:
authorMasahisa Kojima <masahisa.kojima@linaro.org>2022-07-22 11:39:10 +0900
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-08-13 11:09:49 +0200
commitee576662947330748b4cca1890d0e1d826d870f4 (patch)
tree2e37da6b72602d31c044db1670d4068caf7d539b /lib/efi_driver/efi_block_device.c
parente7496e57a045af70fd453f25c827f7c0522a3a71 (diff)
efi_loader: move udevice pointer into struct efi_object
This is a preparation patch to provide the unified method to access udevice pointer associated with the EFI handle by adding udevice pointer into struct efi_object. The patch also introduces a helper function efi_link_dev() to link the udevice and EFI handle. The EFI handles of both EFI block io driver implemented in lib/efi_loader/efi_disk.c and EFI block io driver implemented as EFI payload can access the udevice pointer in the struct efi_object. We can use this udevice pointer to get the U-Boot friendly block device name(e.g. mmc 0:1, nvme 0:1) through EFI handle. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'lib/efi_driver/efi_block_device.c')
-rw-r--r--lib/efi_driver/efi_block_device.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c
index 5baa6f87a3..d57d281f85 100644
--- a/lib/efi_driver/efi_block_device.c
+++ b/lib/efi_driver/efi_block_device.c
@@ -158,8 +158,7 @@ static int efi_bl_bind(efi_handle_t handle, void *interface)
* FIXME: necessary because we won't do almost nothing in
* efi_disk_create() when called from device_probe().
*/
- ret = dev_tag_set_ptr(bdev, DM_TAG_EFI, handle);
- if (ret)
+ if (efi_link_dev(handle, bdev))
/* FIXME: cleanup for bdev */
return ret;