From ee576662947330748b4cca1890d0e1d826d870f4 Mon Sep 17 00:00:00 2001 From: Masahisa Kojima Date: Fri, 22 Jul 2022 11:39:10 +0900 Subject: 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 Reviewed-by: Heinrich Schuchardt --- lib/efi_driver/efi_block_device.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/efi_driver/efi_block_device.c') diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c index 5baa6f87a37..d57d281f850 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; -- cgit v1.2.3