]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
part: call part_init() in blk_get_device_by_str() only for MMC
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Fri, 10 Dec 2021 06:49:28 +0000 (15:49 +0900)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 18 Dec 2021 11:05:19 +0000 (12:05 +0100)
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

index e857a9f958510ed72c368d901b8401fee0fe9455..99f592d96c2bbf99a365ec857c10985ab89faaa3 100644 (file)
@@ -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: