diff options
author | Tian Tao <tiantao6@hisilicon.com> | 2020-08-21 04:19:15 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-09-02 01:49:26 +0300 |
commit | 4ce790632803bf2ec47271895a59936c70df7e78 (patch) | |
tree | fa8a33e197d00bb9649d631fe3c12250660de673 /drivers | |
parent | c4823983538d5fdf38575b3f3ba3a0d10b7f021a (diff) | |
download | linux-4ce790632803bf2ec47271895a59936c70df7e78.tar.xz |
virtio-blk: Use kobj_to_dev() instead of container_of()
Use kobj_to_dev() instead of container_of()
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/virtio_blk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index b2e48dac1ebd..ca63a41059d6 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -646,7 +646,7 @@ static struct attribute *virtblk_attrs[] = { static umode_t virtblk_attrs_are_visible(struct kobject *kobj, struct attribute *a, int n) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); struct gendisk *disk = dev_to_disk(dev); struct virtio_blk *vblk = disk->private_data; struct virtio_device *vdev = vblk->vdev; |