aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSjur Brændeland <sjur.brandeland@stericsson.com>2013-02-13 00:22:36 -0500
committerRusty Russell <rusty@rustcorp.com.au>2013-02-13 01:30:32 -0500
commit6e105e0593055dc4aae21df7bca3868045754148 (patch)
tree87fc747585c5a77cebc6b94e3f2e39de366b6d9a /include
parentdc18f0800f5f16460030a9623d4fcc165d607edf (diff)
virtio: Add module driver macro for virtio drivers.
Add helper macro for drivers that don't do anything special in module init/exit. Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include')
-rw-r--r--include/linux/virtio.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index eb34cf774473..ff6714e6d0f5 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -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 */