aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <[email protected]>2020-11-10 07:25:37 +0100
committerJens Axboe <[email protected]>2020-12-01 14:53:39 -0700
commitefdc41c8d49fc1ff9bbef8f68f1cf1d8d59164a1 (patch)
treea763613547ca892e966fe8b4ec6733df1987b508
parente79319af6d8cfd7311fef1bfbb1c59c94e6e10a9 (diff)
block: use put_device in put_disk
Use put_device to put the device instead of poking into the internals and using kobject_put. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Jan Kara <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Acked-by: Tejun Heo <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
-rw-r--r--block/genhd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 0bd9c41dd4cb..f46e89226fdf 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1803,7 +1803,7 @@ EXPORT_SYMBOL(__alloc_disk_node);
void put_disk(struct gendisk *disk)
{
if (disk)
- kobject_put(&disk_to_dev(disk)->kobj);
+ put_device(disk_to_dev(disk));
}
EXPORT_SYMBOL(put_disk);