From: AKASHI Takahiro Date: Fri, 10 Dec 2021 06:49:28 +0000 (+0900) Subject: part: call part_init() in blk_get_device_by_str() only for MMC X-Git-Url: http://git.dujemihanovic.xyz/img/static/git-favicon.png?a=commitdiff_plain;h=5d21dfec4ac92f8b38130660ed9c4d22712ecab5;p=u-boot.git part: call part_init() in blk_get_device_by_str() only for MMC 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 Reviewed-by: Simon Glass --- diff --git a/disk/part.c b/disk/part.c index e857a9f958..99f592d96c 100644 --- a/disk/part.c +++ b/disk/part.c @@ -430,7 +430,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: