summaryrefslogtreecommitdiffstats
path: root/include/linux/virtio.h
diff options
context:
space:
mode:
authorWanlong Gao <gaowanlong@cn.fujitsu.com>2012-12-11 11:04:50 +1030
committerRusty Russell <rusty@rustcorp.com.au>2012-12-18 15:20:42 +1030
commit9bffdca8c64a72ac54c47a552734ab457bc720d4 (patch)
treec009f6f19b689ceac28122a2ea7109b4fccada95 /include/linux/virtio.h
parent40f9938c4c69183c5ceaca74b77aff636cc79623 (diff)
downloadblackbird-op-linux-9bffdca8c64a72ac54c47a552734ab457bc720d4.tar.gz
blackbird-op-linux-9bffdca8c64a72ac54c47a552734ab457bc720d4.zip
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 {
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);
OpenPOWER on IntegriCloud