drivers/amlogic/mmc: don't use Amlogic partition layout if there is no device tree...
authorNick Xie <nick@khadas.com>
Tue, 23 Jul 2019 08:20:56 +0000 (16:20 +0800)
committerNick Xie <nick@khadas.com>
Tue, 23 Jul 2019 08:20:56 +0000 (16:20 +0800)
Signed-off-by: Nick Xie <nick@khadas.com>
drivers/amlogic/mmc/emmc_partitions.c

index b2bf502..12eaae7 100644 (file)
@@ -1142,6 +1142,9 @@ int aml_emmc_partition_ops(struct mmc_card *card, struct gendisk *disk)
        if (is_card_emmc(card) == 0) /* not emmc, nothing to do */
                return 0;
 
+       if (!of_find_node_by_path("/partitions"))
+               return 0;
+
        buffer = kmalloc(512, GFP_KERNEL);
        if (!buffer)
                return -ENOMEM;