mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-16 01:44:34 +00:00
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>
This commit is contained in:
parent
76a692a2ca
commit
640c6c6cba
1 changed files with 3 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue