omap: Fix warning when looking for userdata part
authorSam Protsenko <semen.protsenko@linaro.org>
Thu, 21 Sep 2017 22:51:59 +0000 (01:51 +0300)
committerTom Rini <trini@konsulko.com>
Fri, 6 Oct 2017 15:28:17 +0000 (11:28 -0400)
When eMMC was formattaed for Linux partition table, "userdata" partition
is missing. In this case, part_get_info_by_name() iterates over all
registered drivers (which are PART_TYPE_EFI, PART_TYPE_DOS and
PART_TYPE_ISO). And when it comes to PART_TYPE_ISO (which has empty
partition table), we can see next warning in U-Boot output:

    ** First descriptor is NOT a primary desc on 1:1 **

This patch switches to part_get_info_by_name_type() API in order to
check only EFI partitions for "userdata" partitions. This eliminates
mentioned warning.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/arm/mach-omap2/utils.c

index f556da4b195165c4f244165c845a92aba339f210..d4f171b0ee15440a3d19495cabe6086198673532 100644 (file)
@@ -91,7 +91,8 @@ static u32 omap_mmc_get_part_size(const char *part)
                return 0;
        }
 
-       res = part_get_info_by_name(dev_desc, part, &info);
+       /* Check only for EFI (GPT) partition table */
+       res = part_get_info_by_name_type(dev_desc, part, &info, PART_TYPE_EFI);
        if (res < 0)
                return 0;