From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: <linux-arm-kernel@lists.infradead.org>
Cc: <linux-kernel@vger.kernel.org>,
Paul Gortmaker <paul.gortmaker@windriver.com>,
Russell King <linux@arm.linux.org.uk>
Subject: [PATCH 1/3] amba: create builtin_amba_driver to avoid registration boilerplate
Date: Sun, 11 Oct 2015 21:35:45 -0400 [thread overview]
Message-ID: <1444613747-17715-2-git-send-email-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <1444613747-17715-1-git-send-email-paul.gortmaker@windriver.com>
In commit f309d4443130bf814e991f836e919dca22df37ae ("platform_device:
better support builtin boilerplate avoidance") we introduced the
builtin_driver macro.
Here we use that support and extend it to amba driver registration,
so where a driver is clearly non-modular and builtin-only, we can
register it in a similar fashion. And existing code that is clearly
non-modular can be updated with the simple mapping of
module_amba_driver(...) ---> builtin_amba_driver(...)
We've essentially cloned the former to make the latter, and taken
out the remove/module_exit parts since those never get used in a
non-modular build of the code.
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
include/linux/amba/bus.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
index 50fc66868402..0e8cb21c20e5 100644
--- a/include/linux/amba/bus.h
+++ b/include/linux/amba/bus.h
@@ -165,4 +165,13 @@ struct amba_device name##_device = { \
#define module_amba_driver(__amba_drv) \
module_driver(__amba_drv, amba_driver_register, amba_driver_unregister)
+/*
+ * builtin_amba_driver() - Helper macro for drivers that don't do anything
+ * special in driver initcall. This eliminates a lot of boilerplate. Each
+ * driver may only use this macro once, and calling it replaces the instance
+ * device_initcall().
+ */
+#define builtin_amba_driver(__amba_drv) \
+ builtin_driver(__amba_drv, amba_driver_register)
+
#endif
--
2.6.1
next prev parent reply other threads:[~2015-10-12 1:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-12 1:35 [PATCH 0/3] amba/coresight: make non-modular code explicitly non-modular Paul Gortmaker
2015-10-12 1:35 ` Paul Gortmaker [this message]
2015-10-12 1:35 ` [PATCH 2/3] drivers/hwtracing: make coresight-* " Paul Gortmaker
2015-10-13 16:48 ` Mathieu Poirier
2015-10-12 1:35 ` [PATCH 3/3] drivers/amba: make tegra-ahb.c " Paul Gortmaker
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=1444613747-17715-2-git-send-email-paul.gortmaker@windriver.com \
--to=paul.gortmaker@windriver.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
/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
Powered by JetHome