summaryrefslogtreecommitdiff
path: root/lib/efi_driver/efi_block_device.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2024-10-18 03:30:14 +0200
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2024-10-18 17:05:19 +0200
commit640c6c6cbaafa1b049118d431cf218d9dce3cdd8 (patch)
treea436284dde2fcfc4a47e1a74762dea90b35a7474 /lib/efi_driver/efi_block_device.c
parent76a692a2ca6acb1f644872289efd84997df429fb (diff)
efi_driver: use blk_create_devicef()
The EFI block device driver is the only user of blk_create_device() outside the block device uclass. Use blk_create_devicef() instead like other block device drivers. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib/efi_driver/efi_block_device.c')
-rw-r--r--lib/efi_driver/efi_block_device.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c
index 34a0365739d..19a5ee24794 100644
--- a/lib/efi_driver/efi_block_device.c
+++ b/lib/efi_driver/efi_block_device.c
@@ -133,15 +133,13 @@ efi_bl_create_block_device(efi_handle_t handle, void *interface)
sprintf(name, "efiblk#%d", devnum);
/* Create driver model udevice for the EFI block io device */
- if (blk_create_device(parent, "efi_blk", name, UCLASS_EFI_LOADER,
- devnum, io->media->block_size,
- (lbaint_t)io->media->last_block, &bdev)) {
+ if (blk_create_devicef(parent, "efi_blk", name, UCLASS_EFI_LOADER,
+ devnum, io->media->block_size,
+ (lbaint_t)io->media->last_block, &bdev)) {
ret = EFI_OUT_OF_RESOURCES;
free(name);
goto err;
}
- /* Set the DM_FLAG_NAME_ALLOCED flag to avoid a memory leak */
- device_set_name_alloced(bdev);
plat = dev_get_plat(bdev);
plat->handle = handle;