From 18aa5a4134e8179c7c3e38675822284a2718a3d8 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Tue, 22 Aug 2017 08:15:16 -0700 Subject: nvme: Get rid of the global variable nvme_info At present the NVMe uclass driver uses a global variable nvme_info to store global information like namespace id, and NVMe controller driver's priv struct has a blk_dev_start that is used to calculate the namespace id based on the global information from nvme_info. This is not a good design in the DM world and can be replaced with the following changes: - Encode the namespace id in the NVMe block device name during the NVMe uclass post probe - Extract the namespace id from the device name during the NVMe block device probe - Let BLK uclass calculate the devnum for us by passing -1 to blk_create_devicef() as the devnum Signed-off-by: Bin Meng --- drivers/nvme/nvme.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'drivers/nvme/nvme.h') diff --git a/drivers/nvme/nvme.h b/drivers/nvme/nvme.h index f0fa6399bf..67bf6e187f 100644 --- a/drivers/nvme/nvme.h +++ b/drivers/nvme/nvme.h @@ -628,13 +628,6 @@ struct nvme_dev { u64 *prp_pool; u32 prp_entry_num; u32 nn; - u32 blk_dev_start; -}; - -struct nvme_info { - int ns_num; /*the number of nvme namespaces*/ - int ndev_num; /*the number of nvme devices*/ - struct list_head dev_list; }; /* @@ -652,6 +645,4 @@ struct nvme_ns { u32 mode_select_block_len; }; -extern struct nvme_info *nvme_info; - #endif /* __DRIVER_NVME_H__ */ -- cgit v1.2.1