summaryrefslogtreecommitdiff
path: root/disk
diff options
context:
space:
mode:
authorAlexey Romanov <avromanov@salutedevices.com>2024-07-18 08:45:26 +0300
committerMichael Trimarchi <michael@amarulasolutions.com>2024-08-08 09:28:02 +0200
commit6b0c9f2cb511b2b06fd675a49162208c9105f2a0 (patch)
treec6625a8316f77c82785069c65c3d8c8fdb0ccbe2 /disk
parent9daad11ad178646c288aca3615a7ba1e6039aed3 (diff)
downloadu-boot-6b0c9f2cb511b2b06fd675a49162208c9105f2a0.tar.gz
u-boot-6b0c9f2cb511b2b06fd675a49162208c9105f2a0.tar.bz2
u-boot-6b0c9f2cb511b2b06fd675a49162208c9105f2a0.zip
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 <avromanov@salutedevices.com> Reviewed-by: Heiko Schocher <hs@denx.de> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Diffstat (limited to 'disk')
-rw-r--r--disk/part.c7
1 files changed, 7 insertions, 0 deletions
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;