diff options
author | Chaitanya Kulkarni <kch@nvidia.com> | 2022-02-10 11:12:36 -0800 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2022-02-28 13:45:06 +0200 |
commit | 72e8b5cd7dd387ba3eee81b0a59746ad8ccdcb5f (patch) | |
tree | 1d141e599fc6dbd614303baef1c489cc4d22f683 /drivers/nvme/host/nvme.h | |
parent | 4686af885a9168f9ec70c4063616640911c48b03 (diff) | |
download | linux-72e8b5cd7dd387ba3eee81b0a59746ad8ccdcb5f.tar.bz2 |
nvme: add a helper to initialize connect_q
Add and use helper to remove duplicate code for fabrics connect_q
initialization and error handling for all the transports.
Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/host/nvme.h')
-rw-r--r-- | drivers/nvme/host/nvme.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index a162f6c6da6e..f8658f984d64 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h @@ -894,6 +894,14 @@ static inline int nvme_update_zone_info(struct nvme_ns *ns, unsigned lbaf) } #endif +static inline int nvme_ctrl_init_connect_q(struct nvme_ctrl *ctrl) +{ + ctrl->connect_q = blk_mq_init_queue(ctrl->tagset); + if (IS_ERR(ctrl->connect_q)) + return PTR_ERR(ctrl->connect_q); + return 0; +} + static inline struct nvme_ns *nvme_get_ns_from_dev(struct device *dev) { return dev_to_disk(dev)->private_data; |