Skip to content

Commit

Permalink
part: call part_init() in blk_get_device_by_str() only for MMC
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
AKASHI Takahiro authored and xypron committed Dec 18, 2021
1 parent 35f3ef9 commit 5d21dfe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion disk/part.c
Expand Up @@ -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:
Expand Down

0 comments on commit 5d21dfe

Please sign in to comment.