diff options
author | Wanlong Gao <gaowanlong@cn.fujitsu.com> | 2012-12-11 04:34:50 +0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2012-12-18 08:50:42 +0400 |
commit | 9bffdca8c64a72ac54c47a552734ab457bc720d4 (patch) | |
tree | c009f6f19b689ceac28122a2ea7109b4fccada95 /include | |
parent | 40f9938c4c69183c5ceaca74b77aff636cc79623 (diff) | |
download | linux-9bffdca8c64a72ac54c47a552734ab457bc720d4.tar.xz |
virtio: use dev_to_virtio wrapper in virtio
Use dev_to_virtio wrapper in virtio to make code clearly.
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/virtio.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 4b8f17d90458..5f1f80c76468 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -85,7 +85,11 @@ struct virtio_device { void *priv; }; -#define dev_to_virtio(dev) container_of(dev, struct virtio_device, dev) +static inline struct virtio_device *dev_to_virtio(struct device *_dev) +{ + return container_of(_dev, struct virtio_device, dev); +} + int register_virtio_device(struct virtio_device *dev); void unregister_virtio_device(struct virtio_device *dev); |