Thread (95 messages) 95 messages, 32 authors, 2014-06-25
STALE4368d

[PATCH] bus/omap_l3: avoid sync initcall for modules

From: arnd@arndb.de (Arnd Bergmann)
Date: 2014-05-08 15:02:38
Also in: lkml
Subsystem: omap2+ support, the rest · Maintainers: Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros, Tony Lindgren, Linus Torvalds

The postcore_initcall_sync() macro is only defined for built-in
code, but the omap_l3 bus code can be built as a module, which
currently causes a build failure.

This works around the problem by using #ifdef MODULE to decide
whether to use a regular module_init() function or not.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Kishon Vijay Abraham I <redacted>
Cc: Felipe Balbi <redacted>
---
 drivers/bus/omap_l3_noc.c | 4 ++++
 drivers/bus/omap_l3_smx.c | 4 ++++
 2 files changed, 8 insertions(+)
diff --git a/drivers/bus/omap_l3_noc.c b/drivers/bus/omap_l3_noc.c
index feeecae..648f158 100644
--- a/drivers/bus/omap_l3_noc.c
+++ b/drivers/bus/omap_l3_noc.c
@@ -257,7 +257,11 @@ static int __init omap4_l3_init(void)
 {
 	return platform_driver_register(&omap4_l3_driver);
 }
+#ifdef MODULE
+module_init(omap4_l3_init);
+#else
 postcore_initcall_sync(omap4_l3_init);
+#endif
 
 static void __exit omap4_l3_exit(void)
 {
diff --git a/drivers/bus/omap_l3_smx.c b/drivers/bus/omap_l3_smx.c
index acc2164..f752d1b 100644
--- a/drivers/bus/omap_l3_smx.c
+++ b/drivers/bus/omap_l3_smx.c
@@ -288,7 +288,11 @@ static int __init omap3_l3_init(void)
 {
 	return platform_driver_probe(&omap3_l3_driver, omap3_l3_probe);
 }
+#ifdef MODULE
+module_init(omap3_l3_init);
+#else
 postcore_initcall_sync(omap3_l3_init);
+#endif
 
 static void __exit omap3_l3_exit(void)
 {
-- 
1.8.3.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help