aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/virtio.h
diff options
context:
space:
mode:
authorWanlong Gao <gaowanlong@cn.fujitsu.com>2012-12-10 19:34:50 -0500
committerRusty Russell <rusty@rustcorp.com.au>2012-12-17 23:50:42 -0500
commit9bffdca8c64a72ac54c47a552734ab457bc720d4 (patch)
treec009f6f19b689ceac28122a2ea7109b4fccada95 /include/linux/virtio.h
parent40f9938c4c69183c5ceaca74b77aff636cc79623 (diff)
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/linux/virtio.h')
-rw-r--r--include/linux/virtio.h6
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 {
85 void *priv; 85 void *priv;
86}; 86};
87 87
88#define dev_to_virtio(dev) container_of(dev, struct virtio_device, dev) 88static inline struct virtio_device *dev_to_virtio(struct device *_dev)
89{
90 return container_of(_dev, struct virtio_device, dev);
91}
92
89int register_virtio_device(struct virtio_device *dev); 93int register_virtio_device(struct virtio_device *dev);
90void unregister_virtio_device(struct virtio_device *dev); 94void unregister_virtio_device(struct virtio_device *dev);
91 95