SDMMC: restrict the mtdpart_partition to be only used to eMMC-disk
authorxbw <xbw@rock-chips.com>
Sun, 23 Mar 2014 23:01:09 +0000 (07:01 +0800)
committerxbw <xbw@rock-chips.com>
Sun, 23 Mar 2014 23:01:09 +0000 (07:01 +0800)
block/partitions/check.c
block/partitions/mtdpart.c

index 2b7baa0614544c578e520fcf72e795218aeaf704..4997581ae64f0c737b427bcff01c4c9137a72f81 100755 (executable)
@@ -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);
index d7c90e872837c79bfe666861d463e20c34eba064..ac2cf4d8efb5b9bca8b2e024c86f4cff0a8e5117 100755 (executable)
@@ -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;