SDMMC: restrict the mtdpart_partition to be only used to eMMC-disk

This commit is contained in:
xbw
2014-03-24 07:01:09 +08:00
parent 9eab9d3526
commit ede376e68e
2 changed files with 9 additions and 0 deletions

View File

@@ -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);

View File

@@ -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;