Skip to contentSkip to conversation

booke_wdt: Fix build failure as a module

PATCH In review Pranith Kumar 2 participants 3 messages Aug 20, 2014 Watchdog device drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 booke_wdt: Fix build failure as a module

Building booke_wdt fails when trying to build as a module as there is no early_param() in module. Fix by enclosing within MODULE check.

Also remove notrace attribute as it is implicit in the __init attribute.

---
 drivers/watchdog/booke_wdt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/watchdog/booke_wdt.c +4 -1
index 08a7853..8a26b54 100644
@@ -41,8 +41,9 @@ u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
 #define WDTP_MASK	(TCR_WP_MASK)
 #endif
 
+#ifndef MODULE
 /* Checks wdt=x and wdt_period=xx command-line option */
-notrace int __init early_parse_wdt(char *p)
+int __init early_parse_wdt(char *p)
 {
 	if (p && strncmp(p, "0", 1) != 0)
 		booke_wdt_enabled = 1;
@@ -63,6 +64,8 @@ int __init early_parse_wdt_period(char *p)
 }
 early_param("wdt_period", early_parse_wdt_period);
 
+#endif /* #ifndef MODULE */
+
 #ifdef CONFIG_PPC_FSL_BOOK3E
 
 /* For the specified period, determine the number of seconds
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 3 lines · Pranith Kumar

Building booke_wdt fails when trying to build as a module as there is no early_param() in module. Fix by enclosing within MODULE check.

Might make more sense to replace the early_param with a normal module parameter. Taking the module parameter away if the driver is built as module seems to be a bit excessive.

Any idea why early_param was chosen over a standard module parameter ?

Guenter

Quoted 39 lines

Also remove notrace attribute as it is implicit in the __init attribute.

---
 drivers/watchdog/booke_wdt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/watchdog/booke_wdt.c +4 -1
index 08a7853..8a26b54 100644
@@ -41,8 +41,9 @@ u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
 #define WDTP_MASK	(TCR_WP_MASK)
 #endif
 
+#ifndef MODULE
 /* Checks wdt=x and wdt_period=xx command-line option */
-notrace int __init early_parse_wdt(char *p)
+int __init early_parse_wdt(char *p)
 {
 	if (p && strncmp(p, "0", 1) != 0)
 		booke_wdt_enabled = 1;
@@ -63,6 +64,8 @@ int __init early_parse_wdt_period(char *p)
 }
 early_param("wdt_period", early_parse_wdt_period);
 
+#endif /* #ifndef MODULE */
+
 #ifdef CONFIG_PPC_FSL_BOOK3E
 
 /* For the specified period, determine the number of seconds
Signature · 6 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
Quoted 9 lines · Guenter Roeck
Quoted 3 lines · Pranith Kumar

Building booke_wdt fails when trying to build as a module as there is no early_param() in module. Fix by enclosing within MODULE check.

Might make more sense to replace the early_param with a normal module parameter. Taking the module parameter away if the driver is built as module seems to be a bit excessive.

Any idea why early_param was chosen over a standard module parameter ?

I didn't really investigate. This showed up in a randconfig build error. I will try to convert this to module param. Thanks!

Signature · 1 line
Pranith