From: sjur.brandeland@stericsson.com
To: Rusty Russell <rusty@rustcorp.com.au>,
"David S. Miller" <davem@davemloft.net>,
Ohad Ben-Cohen <ohad@wizery.com>
Cc: sjur@brendeland.net, netdev@vger.kernel.org,
virtualization@lists.linux-foundation.org,
linux-kernel@vger.kernel.org,
"Dmitry Tarnyagin" <dmitry.tarnyagin@stericsson.com>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Erwan Yvin" <erwan.yvin@stericsson.com>,
"Sjur Brændeland" <sjur.brandeland@stericsson.com>
Subject: [PATCHv2 vringh 2/3] virtio: Add module driver macro for virtio drivers.
Date: Tue, 12 Feb 2013 12:49:52 +0100 [thread overview]
Message-ID: <1360669793-6921-3-git-send-email-sjur.brandeland@stericsson.com> (raw)
In-Reply-To: <1360669793-6921-1-git-send-email-sjur.brandeland@stericsson.com>
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>
---
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
next prev parent reply other threads:[~2013-02-12 11:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-12 11:49 [PATCHv2 vringh 0/3] Introduce CAIF Virtio driver sjur.brandeland
2013-02-12 11:49 ` [PATCHv2 vringh 1/3] remoteproc: Add support for vringh (Host vrings) sjur.brandeland
2013-02-20 16:05 ` Ohad Ben-Cohen
2013-02-20 23:01 ` Sjur Brændeland
2013-02-21 13:47 ` Ohad Ben-Cohen
2013-02-21 17:28 ` Sjur Brændeland
2013-02-21 17:55 ` Ohad Ben-Cohen
2013-02-21 19:36 ` Sjur Brændeland
2013-02-23 9:49 ` Ohad Ben-Cohen
2013-02-21 6:37 ` Rusty Russell
2013-02-21 13:53 ` Ohad Ben-Cohen
2013-02-22 0:42 ` Rusty Russell
2013-02-12 11:49 ` sjur.brandeland [this message]
2013-02-12 11:49 ` [PATCHv2 vringh 3/3] caif_virtio: Introduce caif over virtio sjur.brandeland
2013-02-18 23:37 ` Rusty Russell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1360669793-6921-3-git-send-email-sjur.brandeland@stericsson.com \
--to=sjur.brandeland@stericsson.com \
--cc=davem@davemloft.net \
--cc=dmitry.tarnyagin@stericsson.com \
--cc=erwan.yvin@stericsson.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ohad@wizery.com \
--cc=rusty@rustcorp.com.au \
--cc=sjur@brendeland.net \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).