diff options
author | Tang Bin <tangbin@cmss.chinamobile.com> | 2021-02-22 06:57:24 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2021-03-14 09:37:35 +0100 |
commit | da98b54d02981de5b07d8044b2a632bf6ba3ac45 (patch) | |
tree | 087a941704743b01582d9e5f00590c576d55f766 | |
parent | vdpa: set the virtqueue num during register (diff) | |
download | linux-da98b54d02981de5b07d8044b2a632bf6ba3ac45.tar.xz linux-da98b54d02981de5b07d8044b2a632bf6ba3ac45.zip |
virtio-mmio: Use to_virtio_mmio_device() to simply code
The file virtio_mmio.c has defined the function to_virtio_mmio_device,
so use it instead of container_of() to simply code.
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20210222055724.220-1-tangbin@cmss.chinamobile.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r-- | drivers/virtio/virtio_mmio.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index a286d22b6551..56128b9c46eb 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -548,8 +548,7 @@ static void virtio_mmio_release_dev(struct device *_d) { struct virtio_device *vdev = container_of(_d, struct virtio_device, dev); - struct virtio_mmio_device *vm_dev = - container_of(vdev, struct virtio_mmio_device, vdev); + struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); struct platform_device *pdev = vm_dev->pdev; devm_kfree(&pdev->dev, vm_dev); |