nvme: make partition type depend on saved command line

nvme for rockchip platform could be used as both of main disk
or external storage. So it's not proper to fix the partition
type by checking CONFIG_ARCH_ROCKCHIP. Otherwise, if the nvme
is probed earily then the real main disk device, then the main
disk could be failed to mount.

Change-Id: If30940527e99d88d792fe3f19475fabf4b1a99d3
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
This commit is contained in:
Shawn Lin 2018-08-09 10:03:08 +08:00 committed by Tao Huang
parent 29c4d612eb
commit a3c93d1b46

View File

@ -2299,11 +2299,12 @@ static void nvme_alloc_ns(struct nvme_dev *dev, unsigned nsid)
disk->queue = ns->queue;
disk->driverfs_dev = dev->device;
disk->flags = GENHD_FL_EXT_DEVT;
#ifdef CONFIG_ARCH_ROCKCHIP
disk->is_rk_disk = true;
#else
disk->is_rk_disk = false;
#endif
if (strstr(saved_command_line, "storagemedia=nvme"))
disk->is_rk_disk = true;
else
disk->is_rk_disk = false;
sprintf(disk->disk_name, "nvme%dn%d", dev->instance, nsid);
/*