diff mbox series

[RFC,v2,01/20] part: call part_init() in blk_get_device_by_str() only for MMC

Message ID 20211210064947.73361-2-takahiro.akashi@linaro.org
State Accepted
Commit 5d21dfec4ac92f8b38130660ed9c4d22712ecab5
Headers show
Series efi_loader: more tightly integrate UEFI disks to driver model | expand

Commit Message

AKASHI Takahiro Dec. 10, 2021, 6:49 a.m. UTC
In blk_get_device_by_str(), the comment says: "Updates the partition table
for the specified hw partition."
Since hw partition is supported only on MMC, it makes no sense to do so
for other devices.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
 disk/part.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/disk/part.c b/disk/part.c
index fe1ebd4adf7e..c0556a41e57f 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -427,7 +427,8 @@  int blk_get_device_by_str(const char *ifname, const char *dev_hwpart_str,
 	 * Always should be done, otherwise hw partition 0 will return stale
 	 * data after displaying a non-zero hw partition.
 	 */
-	part_init(*dev_desc);
+	if ((*dev_desc)->if_type == IF_TYPE_MMC)
+		part_init(*dev_desc);
 #endif
 
 cleanup: