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>
This commit is contained in:
Hannes Reinecke
2018-09-28 08:17:19 +02:00
committed by Jens Axboe
parent 6c3b7af1c9
commit fef912bf86
28 changed files with 43 additions and 33 deletions

View File

@@ -2146,7 +2146,7 @@ static int msb_init_disk(struct memstick_dev *card)
set_disk_ro(msb->disk, 1);
msb_start(card);
device_add_disk(&card->dev, msb->disk);
device_add_disk(&card->dev, msb->disk, NULL);
dbg("Disk added");
return 0;

View File

@@ -1236,7 +1236,7 @@ static int mspro_block_init_disk(struct memstick_dev *card)
set_capacity(msb->disk, capacity);
dev_dbg(&card->dev, "capacity set %ld\n", capacity);
device_add_disk(&card->dev, msb->disk);
device_add_disk(&card->dev, msb->disk, NULL);
msb->active = 1;
return 0;