summaryrefslogtreecommitdiff
path: root/drivers/nvme
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-02-09 12:44:03 -0700
committerJens Axboe <axboe@fb.com>2016-02-09 12:44:03 -0700
commitf4f0f63e6f01055dfbdb7bc5e83935e1bdfa1980 (patch)
tree546fde189f2a37476988845d4d131d34753b070d /drivers/nvme
parent949928c1c731417cc0f070912c63878b62b544f4 (diff)
downloadlwn-f4f0f63e6f01055dfbdb7bc5e83935e1bdfa1980.tar.gz
lwn-f4f0f63e6f01055dfbdb7bc5e83935e1bdfa1980.zip
nvme: fix drvdata setup for the nvme device
Pass the right private data to device_create_with_groups from the beginning, and remove the superflous call to dev_set_drvdata. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jon Derrick <jonathan.derrick@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/host/core.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index c5bf001af559..c326931d9b4d 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1383,14 +1383,13 @@ int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev,
ctrl->device = device_create_with_groups(nvme_class, ctrl->dev,
MKDEV(nvme_char_major, ctrl->instance),
- dev, nvme_dev_attr_groups,
+ ctrl, nvme_dev_attr_groups,
"nvme%d", ctrl->instance);
if (IS_ERR(ctrl->device)) {
ret = PTR_ERR(ctrl->device);
goto out_release_instance;
}
get_device(ctrl->device);
- dev_set_drvdata(ctrl->device, ctrl);
spin_lock(&dev_list_lock);
list_add_tail(&ctrl->node, &nvme_ctrl_list);