mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] booke_wdt: Fix build failure as a module
@ 2014-08-20  3:12 Pranith Kumar
  2014-08-20 13:25 ` Guenter Roeck
  0 siblings, 1 reply; 3+ messages in thread
From: Pranith Kumar @ 2014-08-20  3:12 UTC (permalink / raw)
  To: Wim Van Sebroeck, open list:WATCHDOG DEVICE D..., open list

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.

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 drivers/watchdog/booke_wdt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c
index 08a7853..8a26b54 100644
--- a/drivers/watchdog/booke_wdt.c
+++ b/drivers/watchdog/booke_wdt.c
@@ -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
-- 
1.9.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] booke_wdt: Fix build failure as a module
  2014-08-20  3:12 [PATCH] booke_wdt: Fix build failure as a module Pranith Kumar
@ 2014-08-20 13:25 ` Guenter Roeck
  2014-08-20 13:29   ` Pranith Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: Guenter Roeck @ 2014-08-20 13:25 UTC (permalink / raw)
  To: Pranith Kumar; +Cc: Wim Van Sebroeck, open list:WATCHDOG DEVICE D..., open list

On Tue, Aug 19, 2014 at 11:12:07PM -0400, Pranith Kumar wrote:
> 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

> Also remove notrace attribute as it is implicit in the __init attribute.
> 
> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
> ---
>  drivers/watchdog/booke_wdt.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c
> index 08a7853..8a26b54 100644
> --- a/drivers/watchdog/booke_wdt.c
> +++ b/drivers/watchdog/booke_wdt.c
> @@ -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
> -- 
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] booke_wdt: Fix build failure as a module
  2014-08-20 13:25 ` Guenter Roeck
@ 2014-08-20 13:29   ` Pranith Kumar
  0 siblings, 0 replies; 3+ messages in thread
From: Pranith Kumar @ 2014-08-20 13:29 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Wim Van Sebroeck, open list:WATCHDOG DEVICE D..., open list

On Wed, Aug 20, 2014 at 9:25 AM, Guenter Roeck <linux@roeck-us.net> wrote:
> On Tue, Aug 19, 2014 at 11:12:07PM -0400, Pranith Kumar wrote:
>> 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!

-- 
Pranith

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-20 13:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-20  3:12 [PATCH] booke_wdt: Fix build failure as a module Pranith Kumar
2014-08-20 13:25 ` Guenter Roeck
2014-08-20 13:29   ` Pranith Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®