* [PATCH] virtio: Add module driver macro for virtio drivers.
@ 2013-02-11 14:35 sjur.brandeland
2013-02-13 5:22 ` Rusty Russell
0 siblings, 1 reply; 2+ messages in thread
From: sjur.brandeland @ 2013-02-11 14:35 UTC (permalink / raw)
To: Rusty Russell; +Cc: sjur, Sjur Brændeland, virtualization
From: Sjur Brændeland <sjur.brandeland@stericsson.com>
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>
---
Hi Rusty,
Here is the patch for module driver macro.
I will update caif_virtio accordingly
in my next patch-set.
Thanks,
Sjur
include/linux/virtio.h | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index cf8adb1..00ccc40 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 */
--
1.7.5.4
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] virtio: Add module driver macro for virtio drivers.
2013-02-11 14:35 [PATCH] virtio: Add module driver macro for virtio drivers sjur.brandeland
@ 2013-02-13 5:22 ` Rusty Russell
0 siblings, 0 replies; 2+ messages in thread
From: Rusty Russell @ 2013-02-13 5:22 UTC (permalink / raw)
Cc: sjur, Sjur Brændeland, virtualization
sjur.brandeland@stericsson.com writes:
> From: Sjur Brændeland <sjur.brandeland@stericsson.com>
>
> 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>
Applied!
Thanks,
Rusty.
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-02-13 5:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-11 14:35 [PATCH] virtio: Add module driver macro for virtio drivers sjur.brandeland
2013-02-13 5:22 ` Rusty Russell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.