mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
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 <[email protected]> Signed-off-by: Hannes Reinecke <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
6c3b7af1c9
commit
fef912bf86
28 changed files with 43 additions and 33 deletions
|
|
@ -290,7 +290,7 @@ static int nsblk_attach_disk(struct nd_namespace_blk *nsblk)
|
|||
}
|
||||
|
||||
set_capacity(disk, available_disk_size >> SECTOR_SHIFT);
|
||||
device_add_disk(dev, disk);
|
||||
device_add_disk(dev, disk, NULL);
|
||||
revalidate_disk(disk);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1556,7 +1556,7 @@ static int btt_blk_init(struct btt *btt)
|
|||
}
|
||||
}
|
||||
set_capacity(btt->btt_disk, btt->nlba * btt->sector_size >> 9);
|
||||
device_add_disk(&btt->nd_btt->dev, btt->btt_disk);
|
||||
device_add_disk(&btt->nd_btt->dev, btt->btt_disk, NULL);
|
||||
btt->nd_btt->size = btt->nlba * (u64)btt->sector_size;
|
||||
revalidate_disk(btt->btt_disk);
|
||||
|
||||
|
|
|
|||
|
|
@ -474,7 +474,7 @@ static int pmem_attach_disk(struct device *dev,
|
|||
gendev = disk_to_dev(disk);
|
||||
gendev->groups = pmem_attribute_groups;
|
||||
|
||||
device_add_disk(dev, disk);
|
||||
device_add_disk(dev, disk, NULL);
|
||||
if (devm_add_action_or_reset(dev, pmem_release_disk, pmem))
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue