summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-08-12 04:34:59 +0300
committerTom Rini <trini@konsulko.com>2022-09-16 18:05:16 +0300
commite33a5c6be55e7c012b2851f9bdf90e7f607e72bf (patch)
tree19041e9f1b54a5d2811c96e88132ba44fe31243b /lib
parentadbfe8edc3389ba635229195a95217d8b0dfa182 (diff)
downloadu-boot-e33a5c6be55e7c012b2851f9bdf90e7f607e72bf.tar.xz
blk: Switch over to using uclass IDs
We currently have an if_type (interface type) and a uclass id. These are closely related and we don't need to have both. Drop the if_type values and use the uclass ones instead. Maintain the existing, subtle, one-way conversion between UCLASS_USB and UCLASS_MASS_STORAGE for now, and add a comment. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_driver/efi_block_device.c4
-rw-r--r--lib/efi_loader/efi_disk.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c
index d57d281f85..3177ab67b8 100644
--- a/lib/efi_driver/efi_block_device.c
+++ b/lib/efi_driver/efi_block_device.c
@@ -128,7 +128,7 @@ static int efi_bl_bind(efi_handle_t handle, void *interface)
if (!obj)
return -ENOENT;
- devnum = blk_find_max_devnum(IF_TYPE_EFI_LOADER);
+ devnum = blk_find_max_devnum(UCLASS_EFI_LOADER);
if (devnum == -ENODEV)
devnum = 0;
else if (devnum < 0)
@@ -140,7 +140,7 @@ static int efi_bl_bind(efi_handle_t handle, void *interface)
sprintf(name, "efiblk#%d", devnum);
/* Create driver model udevice for the EFI block io device */
- ret = blk_create_device(parent, "efi_blk", name, IF_TYPE_EFI_LOADER,
+ ret = blk_create_device(parent, "efi_blk", name, UCLASS_EFI_LOADER,
devnum, io->media->block_size,
(lbaint_t)io->media->last_block, &bdev);
if (ret)
diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
index a34ca46a11..819dcb4f13 100644
--- a/lib/efi_loader/efi_disk.c
+++ b/lib/efi_loader/efi_disk.c
@@ -640,7 +640,7 @@ static int efi_disk_probe(void *ctx, struct event *event)
* has already created an efi_disk at this moment.
*/
desc = dev_get_uclass_plat(dev);
- if (desc->if_type != IF_TYPE_EFI_LOADER) {
+ if (desc->if_type != UCLASS_EFI_LOADER) {
ret = efi_disk_create_raw(dev);
if (ret)
return -1;
@@ -675,7 +675,7 @@ static int efi_disk_delete_raw(struct udevice *dev)
return -1;
desc = dev_get_uclass_plat(dev);
- if (desc->if_type != IF_TYPE_EFI_LOADER) {
+ if (desc->if_type != UCLASS_EFI_LOADER) {
diskobj = container_of(handle, struct efi_disk_obj, header);
efi_free_pool(diskobj->dp);
}