[PATCH 2/2] efi_loader: fill media_id from block device descriptor

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Thu Sep 15 22:02:42 CEST 2022


Fill the media ID in the block IO protocol from the block device descriptor
of the driver model.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
---
 lib/efi_loader/efi_disk.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
index 73745ccaa0..35790aa86d 100644
--- a/lib/efi_loader/efi_disk.c
+++ b/lib/efi_loader/efi_disk.c
@@ -476,11 +476,7 @@ static efi_status_t efi_disk_add_dev(
 	/* Fill in EFI IO Media info (for read/write callbacks) */
 	diskobj->media.removable_media = desc->removable;
 	diskobj->media.media_present = 1;
-	/*
-	 * MediaID is just an arbitrary counter.
-	 * We have to change it if the medium is removed or changed.
-	 */
-	diskobj->media.media_id = 1;
+	diskobj->media.media_id = desc->media_id;
 	diskobj->media.block_size = desc->blksz;
 	diskobj->media.io_align = desc->blksz;
 	if (part)
-- 
2.37.2



More information about the U-Boot mailing list