summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host
diff options
context:
space:
mode:
authorHannes Reinecke2018-09-28 08:17:19 +0200
committerJens Axboe2018-09-28 16:30:28 +0200
commitfef912bf860e8e7e48a2bfb978a356bba743a8b7 (patch)
tree5cc5e4a4a02c9b898a1afc8e056664b762a1c852 /drivers/nvme/host
parentkyber: add tracepoints (diff)
downloadkernel-qcow2-linux-fef912bf860e8e7e48a2bfb978a356bba743a8b7.tar.gz
kernel-qcow2-linux-fef912bf860e8e7e48a2bfb978a356bba743a8b7.tar.xz
kernel-qcow2-linux-fef912bf860e8e7e48a2bfb978a356bba743a8b7.zip
block: genhd: add 'groups' argument to device_add_disk
Update device_add_disk() to take an 'groups' argument so that individual drivers can register a device with additional sysfs attributes. This avoids race condition the driver would otherwise have if these groups were to be created with sysfs_add_groups(). Signed-off-by: Martin Wilck <martin.wilck@suse.com> Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/nvme/host')
-rw-r--r--drivers/nvme/host/core.c2
-rw-r--r--drivers/nvme/host/multipath.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index dd8ec1dd9219..0e824e8c8fd7 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3099,7 +3099,7 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
nvme_get_ctrl(ctrl);
- device_add_disk(ctrl->device, ns->disk);
+ device_add_disk(ctrl->device, ns->disk, NULL);
if (sysfs_create_group(&disk_to_dev(ns->disk)->kobj,
&nvme_ns_id_attr_group))
pr_warn("%s: failed to create sysfs group for identification\n",
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 5a9562881d4e..477af51d01e8 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -283,7 +283,7 @@ static void nvme_mpath_set_live(struct nvme_ns *ns)
return;
if (!(head->disk->flags & GENHD_FL_UP)) {
- device_add_disk(&head->subsys->dev, head->disk);
+ device_add_disk(&head->subsys->dev, head->disk, NULL);
if (sysfs_create_group(&disk_to_dev(head->disk)->kobj,
&nvme_ns_id_attr_group))
dev_warn(&head->subsys->dev,