BUG: if CONFIG_EMMC_RK is defined but storage memory is FLASH,
it will fail to check sd card partition
emmc failed to load ==>
sdcard's disk->first_minor = 0 ==>
sdcard's msdos_partition return 0
WARN: if disk's flags: 2(include/linux/genhd.h) is defined in new kernel version,
it maybe a problem!
md->disk->driverfs_dev = parent;
set_disk_ro(md->disk, md->read_only || default_ro);
md->disk->flags = GENHD_FL_EXT_DEVT;
+#ifdef CONFIG_EMMC_RK
+ if(HOST_IS_EMMC(card->host))
+ md->disk->flags |= 2; /* 2 is unused flags in 'include/linux/genhd.h' */
+#endif
/*
* As discussed on lkml, GENHD_FL_REMOVABLE should:
struct fat_boot_sector *fb;
int slot;
#ifdef CONFIG_EMMC_RK
- //if card is emmc, msdos_partition return false
- if(state->bdev->bd_disk->major == MMC_BLOCK_MAJOR &&state->bdev->bd_disk->first_minor == 0)
+ //if card is emmc(flag:2 is set in 'drivers/mmc/card/block.c'), return false
+ if(state->bdev->bd_disk->flags & 2)
return 0;
#endif
if(n < SECTOR_1G)
return 0;
- if (state->bdev->bd_disk->major != MMC_BLOCK_MAJOR || state->bdev->bd_disk->first_minor != 0)
+ if (!(state->bdev->bd_disk->flags & 2))
return 0;
cmdline = strstr(saved_command_line, "mtdparts=") + 9;