aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/virtio.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/virtio.h')
-rw-r--r--include/linux/virtio.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index cf8adb1f5b2c..ff6714e6d0f5 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -78,7 +78,7 @@ struct virtio_device {
78 int index; 78 int index;
79 struct device dev; 79 struct device dev;
80 struct virtio_device_id id; 80 struct virtio_device_id id;
81 struct virtio_config_ops *config; 81 const struct virtio_config_ops *config;
82 struct list_head vqs; 82 struct list_head vqs;
83 /* Note that this is a Linux set_bit-style bitmap. */ 83 /* Note that this is a Linux set_bit-style bitmap. */
84 unsigned long features[1]; 84 unsigned long features[1];
@@ -126,4 +126,13 @@ static inline struct virtio_driver *drv_to_virtio(struct device_driver *drv)
126 126
127int register_virtio_driver(struct virtio_driver *drv); 127int register_virtio_driver(struct virtio_driver *drv);
128void unregister_virtio_driver(struct virtio_driver *drv); 128void unregister_virtio_driver(struct virtio_driver *drv);
129
130/* module_virtio_driver() - Helper macro for drivers that don't do
131 * anything special in module init/exit. This eliminates a lot of
132 * boilerplate. Each module may only use this macro once, and
133 * calling it replaces module_init() and module_exit()
134 */
135#define module_virtio_driver(__virtio_driver) \
136 module_driver(__virtio_driver, register_virtio_driver, \
137 unregister_virtio_driver)
129#endif /* _LINUX_VIRTIO_H */ 138#endif /* _LINUX_VIRTIO_H */