From: Sjur Brændeland Date: Wed, 13 Feb 2013 05:22:36 +0000 (+1030) Subject: virtio: Add module driver macro for virtio drivers. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6e105e0593055dc4aae21df7bca3868045754148;p=linux-beck.git 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 Signed-off-by: Rusty Russell --- 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) int register_virtio_driver(struct virtio_driver *drv); void unregister_virtio_driver(struct virtio_driver *drv); + +/* module_virtio_driver() - Helper macro for drivers that don't do + * anything special in module init/exit. This eliminates a lot of + * boilerplate. Each module may only use this macro once, and + * calling it replaces module_init() and module_exit() + */ +#define module_virtio_driver(__virtio_driver) \ + module_driver(__virtio_driver, register_virtio_driver, \ + unregister_virtio_driver) #endif /* _LINUX_VIRTIO_H */