From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
To: gregkh@linuxfoundation.org, dmitry.torokhov@gmail.com,
falcon@meizu.com, tiwai@suse.de, tj@kernel.org,
arjan@linux.intel.com
Cc: linux-kernel@vger.kernel.org, oleg@redhat.com,
akpm@linux-foundation.org, penguin-kernel@i-love.sakura.ne.jp,
joseph.salisbury@canonical.com, bpoirier@suse.de,
"Luis R. Rodriguez" <mcgrof@suse.com>
Subject: [RFC v1 1/3] driver-core: split module_init() and module_exit()
Date: Sun, 31 Aug 2014 02:03:18 -0700 [thread overview]
Message-ID: <1409475800-17573-2-git-send-email-mcgrof@do-not-panic.com> (raw)
In-Reply-To: <1409475800-17573-1-git-send-email-mcgrof@do-not-panic.com>
From: "Luis R. Rodriguez" <mcgrof@suse.com>
module_init() currently is the default caller used
for all other types of *_init() calls for modules.
If we want to do something a bit different for
init groups though we are implicating that onto
the other ones. Lets instead use a generic drv_init()
which maps to what module_init() used to be. For
now module_init() will also map to drv_init() but
the idea is that we'll change this eventually.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
include/linux/init.h | 43 +++++++++++++++++++++++--------------------
1 file changed, 23 insertions(+), 20 deletions(-)
diff --git a/include/linux/init.h b/include/linux/init.h
index 2df8e8d..3b69b1a 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -304,37 +304,40 @@ void __init parse_early_options(char *cmdline);
* matter when built as a loadable module. Like bus
* snooping debug drivers.
*/
-#define early_initcall(fn) module_init(fn)
-#define core_initcall(fn) module_init(fn)
-#define core_initcall_sync(fn) module_init(fn)
-#define postcore_initcall(fn) module_init(fn)
-#define postcore_initcall_sync(fn) module_init(fn)
-#define arch_initcall(fn) module_init(fn)
-#define subsys_initcall(fn) module_init(fn)
-#define subsys_initcall_sync(fn) module_init(fn)
-#define fs_initcall(fn) module_init(fn)
-#define fs_initcall_sync(fn) module_init(fn)
-#define rootfs_initcall(fn) module_init(fn)
-#define device_initcall(fn) module_init(fn)
-#define device_initcall_sync(fn) module_init(fn)
-#define late_initcall(fn) module_init(fn)
-#define late_initcall_sync(fn) module_init(fn)
-
-#define console_initcall(fn) module_init(fn)
-#define security_initcall(fn) module_init(fn)
+#define early_initcall(fn) drv_init(fn)
+#define core_initcall(fn) drv_init(fn)
+#define core_initcall_sync(fn) drv_init(fn)
+#define postcore_initcall(fn) drv_init(fn)
+#define postcore_initcall_sync(fn) drv_init(fn)
+#define arch_initcall(fn) drv_init(fn)
+#define subsys_initcall(fn) drv_init(fn)
+#define subsys_initcall_sync(fn) drv_init(fn)
+#define fs_initcall(fn) drv_init(fn)
+#define fs_initcall_sync(fn) drv_init(fn)
+#define rootfs_initcall(fn) drv_init(fn)
+#define device_initcall(fn) drv_init(fn)
+#define device_initcall_sync(fn) drv_init(fn)
+#define late_initcall(fn) drv_init(fn)
+#define late_initcall_sync(fn) drv_init(fn)
+
+#define console_initcall(fn) drv_init(fn)
+#define security_initcall(fn) drv_init(fn)
/* Each module must use one module_init(). */
-#define module_init(initfn) \
+#define drv_init(initfn) \
static inline initcall_t __inittest(void) \
{ return initfn; } \
int init_module(void) __attribute__((alias(#initfn)));
/* This is only required if you want to be unloadable. */
-#define module_exit(exitfn) \
+#define drv_exit(exitfn) \
static inline exitcall_t __exittest(void) \
{ return exitfn; } \
void cleanup_module(void) __attribute__((alias(#exitfn)));
+#define module_init(initfn) drv_init(initfn);
+#define module_exit(exitfn) drv_exit(exitfn);
+
#define __setup_param(str, unique_id, fn) /* nothing */
#define __setup(str, func) /* nothing */
#endif
--
2.0.3
next prev parent reply other threads:[~2014-08-31 9:03 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-31 9:03 [RFC v1 0/3] driver-core: add asynch module loading support Luis R. Rodriguez
2014-08-31 9:03 ` Luis R. Rodriguez [this message]
2014-08-31 9:03 ` [RFC v1 2/3] async: move synchronous caller into a helper Luis R. Rodriguez
2014-08-31 9:03 ` [RFC v1 3/3] async: add driver asynch levels Luis R. Rodriguez
2014-08-31 10:13 ` [RFC v1 0/3] driver-core: add asynch module loading support Tejun Heo
2014-08-31 11:02 ` Tejun Heo
2014-08-31 11:05 ` Tejun Heo
2014-08-31 17:52 ` Dmitry Torokhov
2014-08-31 19:26 ` Arjan van de Ven
2014-08-31 20:11 ` Dmitry Torokhov
2014-08-31 11:25 ` David Herrmann
2014-08-31 11:38 ` Tejun Heo
2014-08-31 18:28 ` Dmitry Torokhov
2014-08-31 22:02 ` Tejun Heo
2014-08-31 23:06 ` Dmitry Torokhov
2014-08-31 23:40 ` Tejun Heo
2014-08-31 14:44 ` Arjan van de Ven
2014-08-31 17:50 ` Dmitry Torokhov
2014-08-31 19:24 ` Arjan van de Ven
2014-08-31 19:31 ` Greg KH
2014-08-31 20:14 ` Dmitry Torokhov
2014-08-31 20:40 ` Greg KH
2014-08-31 21:53 ` Tejun Heo
2014-08-31 22:15 ` Greg KH
2014-08-31 22:53 ` Tejun Heo
2014-08-31 23:20 ` Arjan van de Ven
2014-08-31 23:29 ` Tejun Heo
2014-08-31 22:51 ` Dmitry Torokhov
2014-08-31 23:03 ` Tejun Heo
2014-09-04 21:21 ` Luis R. Rodriguez
2014-09-04 21:52 ` Greg KH
2014-08-31 16:41 ` Greg KH
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=1409475800-17573-2-git-send-email-mcgrof@do-not-panic.com \
--to=mcgrof@do-not-panic.com \
--cc=akpm@linux-foundation.org \
--cc=arjan@linux.intel.com \
--cc=bpoirier@suse.de \
--cc=dmitry.torokhov@gmail.com \
--cc=falcon@meizu.com \
--cc=gregkh@linuxfoundation.org \
--cc=joseph.salisbury@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@suse.com \
--cc=oleg@redhat.com \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=tiwai@suse.de \
--cc=tj@kernel.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