diff options
author | Wanlong Gao <gaowanlong@cn.fujitsu.com> | 2012-12-11 11:04:50 +1030 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2015-02-20 00:49:34 +0000 |
commit | ddabe0f7922dc94249030ce3f3f7cae9ef34dbe3 (patch) | |
tree | 233ae68bb96fd0d3dccb404a870e8a68bf5b0ab2 /include/linux | |
parent | 48bcfa6c64a2b8a716e7b1b02ef7a0a8cbe9ecc3 (diff) | |
download | lwn-ddabe0f7922dc94249030ce3f3f7cae9ef34dbe3.tar.gz lwn-ddabe0f7922dc94249030ce3f3f7cae9ef34dbe3.zip |
virtio: use dev_to_virtio wrapper in virtio
commit 9bffdca8c64a72ac54c47a552734ab457bc720d4 upstream.
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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include/linux')
-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 96c78437d32f..e4807aff7bac 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -127,7 +127,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); |