From: Alexey Romanov Date: Thu, 18 Jul 2024 05:45:26 +0000 (+0300) Subject: disk: don't try search for partition type if already set X-Git-Url: http://git.dujemihanovic.xyz/%22http:/www.sics.se/static/git-favicon.png?a=commitdiff_plain;h=6b0c9f2cb511b2b06fd675a49162208c9105f2a0;p=u-boot.git disk: don't try search for partition type if already set Block devices can already set partition type at initialization stage, so, in this case is no point in searching for partition type. Signed-off-by: Alexey Romanov Reviewed-by: Heiko Schocher Signed-off-by: Michael Trimarchi --- diff --git a/disk/part.c b/disk/part.c index 86f669926e..706d77b319 100644 --- a/disk/part.c +++ b/disk/part.c @@ -285,6 +285,13 @@ void part_init(struct blk_desc *desc) blkcache_invalidate(desc->uclass_id, desc->devnum); + if (desc->part_type != PART_TYPE_UNKNOWN) { + for (entry = drv; entry != drv + n_ents; entry++) { + if (entry->part_type == desc->part_type && !entry->test(desc)) + return; + } + } + desc->part_type = PART_TYPE_UNKNOWN; for (entry = drv; entry != drv + n_ents; entry++) { int ret;