summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTian Tao <tiantao6@hisilicon.com>2020-08-21 03:19:15 +0200
committerJens Axboe <axboe@kernel.dk>2020-09-02 00:49:26 +0200
commit4ce790632803bf2ec47271895a59936c70df7e78 (patch)
treefa8a33e197d00bb9649d631fe3c12250660de673
parentraw: deprecate the raw driver (diff)
downloadlinux-4ce790632803bf2ec47271895a59936c70df7e78.tar.xz
linux-4ce790632803bf2ec47271895a59936c70df7e78.zip
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>
-rw-r--r--drivers/block/virtio_blk.c2
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;