[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1409475800-17573-2-git-send-email-mcgrof@do-not-panic.com>
Date: Sun, 31 Aug 2014 02:03:18 -0700
From: "Luis R. Rodriguez" <mcgrof@...not-panic.com>
To: gregkh@...uxfoundation.org, dmitry.torokhov@...il.com,
falcon@...zu.com, tiwai@...e.de, tj@...nel.org,
arjan@...ux.intel.com
Cc: linux-kernel@...r.kernel.org, oleg@...hat.com,
akpm@...ux-foundation.org, penguin-kernel@...ove.sakura.ne.jp,
joseph.salisbury@...onical.com, bpoirier@...e.de,
"Luis R. Rodriguez" <mcgrof@...e.com>
Subject: [RFC v1 1/3] driver-core: split module_init() and module_exit()
From: "Luis R. Rodriguez" <mcgrof@...e.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@...uxfoundation.org>
Cc: Tejun Heo <tj@...nel.org>
Cc: Arjan van de Ven <arjan@...ux.intel.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@...e.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists