From: xbw Date: Sun, 23 Mar 2014 23:01:09 +0000 (+0800) Subject: SDMMC: restrict the mtdpart_partition to be only used to eMMC-disk X-Git-Tag: firefly_0821_release~5879 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ede376e68e11e51d6c0cf77fd3bec09691100dc5;p=firefly-linux-kernel-4.4.55.git SDMMC: restrict the mtdpart_partition to be only used to eMMC-disk --- diff --git a/block/partitions/check.c b/block/partitions/check.c index 2b7baa061454..4997581ae64f 100755 --- a/block/partitions/check.c +++ b/block/partitions/check.c @@ -163,6 +163,11 @@ check_partition(struct gendisk *hd, struct block_device *bdev) sprintf(state->name, "p"); i = res = err = 0; + + //if the disk is eMMC,then skip directly the check_part to mtdpart_partition; added by xbw, at 2014-03-24 + if((179 == MAJOR(bdev->bd_dev)&& (1 == hd->emmc_disk))) + i=sizeof(check_part)/sizeof(struct parsed_partitions *)-2; + while (!res && check_part[i]) { memset(state->parts, 0, state->limit * sizeof(state->parts[0])); res = check_part[i++](state); diff --git a/block/partitions/mtdpart.c b/block/partitions/mtdpart.c index d7c90e872837..ac2cf4d8efb5 100755 --- a/block/partitions/mtdpart.c +++ b/block/partitions/mtdpart.c @@ -336,6 +336,10 @@ int mtdpart_partition(struct parsed_partitions *state) if(n < SECTOR_1G) return 0; + + //only used to eMMC-disk + if(1 != state->bdev->bd_disk->emmc_disk) + return 0; cmdline = strstr(saved_command_line, "mtdparts=") + 9;