From a3c93d1b469401211e66fdec965810c1a41087f9 Mon Sep 17 00:00:00 2001 From: Shawn Lin Date: Thu, 9 Aug 2018 10:03:08 +0800 Subject: [PATCH] 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 --- drivers/nvme/host/pci.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index be33d66e2134..9df60a96a67e 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -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); /*