]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
disk: don't try search for partition type if already set
authorAlexey Romanov <avromanov@salutedevices.com>
Thu, 18 Jul 2024 05:45:26 +0000 (08:45 +0300)
committerMichael Trimarchi <michael@amarulasolutions.com>
Thu, 8 Aug 2024 07:28:02 +0000 (09:28 +0200)
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>
disk/part.c

index 86f669926e1516d8c7ef3fe009cf0990ba26beec..706d77b3194fb230d02dbbf861169de8db90be76 100644 (file)
@@ -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;