Merge branch android-common-3.10
[firefly-linux-kernel-4.4.55.git] / block / partitions / check.c
old mode 100644 (file)
new mode 100755 (executable)
index 19ba207..b7c76e4
@@ -19,7 +19,6 @@
 #include <linux/genhd.h>
 
 #include "check.h"
-
 #include "acorn.h"
 #include "amiga.h"
 #include "atari.h"
@@ -34,6 +33,8 @@
 #include "efi.h"
 #include "karma.h"
 #include "sysv68.h"
+#include "rk.h"
+#include "cmdline.h"
 
 int warn_no_part = 1; /*This is ugly: should make genhd removable media aware*/
 
@@ -65,6 +66,9 @@ static int (*check_part[])(struct parsed_partitions *) = {
        adfspart_check_ADFS,
 #endif
 
+#ifdef CONFIG_CMDLINE_PARTITION
+       cmdline_partition,
+#endif
 #ifdef CONFIG_EFI_PARTITION
        efi_partition,          /* this must come before msdos */
 #endif
@@ -104,6 +108,10 @@ static int (*check_part[])(struct parsed_partitions *) = {
 #ifdef CONFIG_SYSV68_PARTITION
        sysv68_partition,
 #endif
+#ifdef CONFIG_RK_PARTITION
+       rkpart_partition,
+#endif
+
        NULL
 };
 
@@ -157,6 +165,13 @@ check_partition(struct gendisk *hd, struct block_device *bdev)
                sprintf(state->name, "p");
 
        i = res = err = 0;
+
+       /* Rockchip partition table ONLY used by eMMC disk */
+       #ifdef CONFIG_RK_PARTITION
+       if ((179 == MAJOR(bdev->bd_dev) && (1 == hd->emmc_disk)))
+               i = sizeof(check_part) / sizeof(struct parsed_partitions *) - 2;
+       #endif
+
        while (!res && check_part[i]) {
                memset(state->parts, 0, state->limit * sizeof(state->parts[0]));
                res = check_part[i++](state);