* [PATCH v2] powerpc: booke_wdt: Fix build error as a module
@ 2014-08-20 19:26 Pranith Kumar
2014-08-20 20:10 ` Guenter Roeck
2014-08-20 21:31 ` Guenter Roeck
0 siblings, 2 replies; 4+ messages in thread
From: Pranith Kumar @ 2014-08-20 19:26 UTC (permalink / raw)
To: Wim Van Sebroeck, open list:WATCHDOG DEVICE D..., open list; +Cc: Guenter Roeck
Building booke_wdt fails when trying to build as a module as there is no
early_param() in module. Fix by using module_param() instead of early_param().
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
CC: Guenter Roeck <linux@roeck-us.net>
---
drivers/watchdog/booke_wdt.c | 28 +++++-----------------------
1 file changed, 5 insertions(+), 23 deletions(-)
diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c
index 08a7853..e96b09b 100644
--- a/drivers/watchdog/booke_wdt.c
+++ b/drivers/watchdog/booke_wdt.c
@@ -30,8 +30,6 @@
* occur, and the final time the board will reset.
*/
-u32 booke_wdt_enabled;
-u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
#ifdef CONFIG_PPC_FSL_BOOK3E
#define WDTP(x) ((((x)&0x3)<<30)|(((x)&0x3c)<<15))
@@ -41,27 +39,10 @@ u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
#define WDTP_MASK (TCR_WP_MASK)
#endif
-/* Checks wdt=x and wdt_period=xx command-line option */
-notrace int __init early_parse_wdt(char *p)
-{
- if (p && strncmp(p, "0", 1) != 0)
- booke_wdt_enabled = 1;
-
- return 0;
-}
-early_param("wdt", early_parse_wdt);
-
-int __init early_parse_wdt_period(char *p)
-{
- unsigned long ret;
- if (p) {
- if (!kstrtol(p, 0, &ret))
- booke_wdt_period = ret;
- }
-
- return 0;
-}
-early_param("wdt_period", early_parse_wdt_period);
+static bool booke_wdt_enabled;
+module_param(booke_wdt_enabled, bool, 0);
+static int booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
+module_param(booke_wdt_period, int, 0);
#ifdef CONFIG_PPC_FSL_BOOK3E
@@ -259,5 +240,6 @@ static int __init booke_wdt_init(void)
module_init(booke_wdt_init);
module_exit(booke_wdt_exit);
+MODULE_ALIAS("booke_wdt");
MODULE_DESCRIPTION("PowerPC Book-E watchdog driver");
MODULE_LICENSE("GPL");
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] powerpc: booke_wdt: Fix build error as a module
2014-08-20 19:26 [PATCH v2] powerpc: booke_wdt: Fix build error as a module Pranith Kumar
@ 2014-08-20 20:10 ` Guenter Roeck
2014-08-20 20:19 ` Pranith Kumar
2014-08-20 21:31 ` Guenter Roeck
1 sibling, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2014-08-20 20:10 UTC (permalink / raw)
To: Pranith Kumar; +Cc: Wim Van Sebroeck, open list:WATCHDOG DEVICE D..., open list
On Wed, Aug 20, 2014 at 03:26:46PM -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 using module_param() instead of early_param().
>
> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
> CC: Guenter Roeck <linux@roeck-us.net>
Looks good as far as I can see. One question though:
> +MODULE_ALIAS("booke_wdt");
Is this necessary ? If yes, shouldn't it be a separate patch to be applied
to -stable ?
Thanks,
Guenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] powerpc: booke_wdt: Fix build error as a module
2014-08-20 20:10 ` Guenter Roeck
@ 2014-08-20 20:19 ` Pranith Kumar
0 siblings, 0 replies; 4+ messages in thread
From: Pranith Kumar @ 2014-08-20 20:19 UTC (permalink / raw)
To: Guenter Roeck; +Cc: Wim Van Sebroeck, open list:WATCHDOG DEVICE D..., open list
On Wed, Aug 20, 2014 at 4:10 PM, Guenter Roeck <linux@roeck-us.net> wrote:
> On Wed, Aug 20, 2014 at 03:26:46PM -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 using module_param() instead of early_param().
>>
>> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
>> CC: Guenter Roeck <linux@roeck-us.net>
>
> Looks good as far as I can see. One question though:
>
>> +MODULE_ALIAS("booke_wdt");
>
> Is this necessary ? If yes, shouldn't it be a separate patch to be applied
> to -stable ?
Suppose this was actually built as a module. How do you pass the
module parameters to this module? Only ways I know of are
./insmod booke_wdt booke_wdt_enabled=1 booke_wdt_period=3
or pass booke_wdt.booke_wdt_enabled=1 on the kernel boot params list.
So the alias is necessary to refer to this module to pass params.
About separate patch, I think it is only with conversion to
module_param() that we need this alias.
Am I missing something?
--
Pranith
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] powerpc: booke_wdt: Fix build error as a module
2014-08-20 19:26 [PATCH v2] powerpc: booke_wdt: Fix build error as a module Pranith Kumar
2014-08-20 20:10 ` Guenter Roeck
@ 2014-08-20 21:31 ` Guenter Roeck
1 sibling, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2014-08-20 21:31 UTC (permalink / raw)
To: Pranith Kumar; +Cc: Wim Van Sebroeck, open list:WATCHDOG DEVICE D..., open list
On Wed, Aug 20, 2014 at 03:26:46PM -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 using module_param() instead of early_param().
>
> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
> CC: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-08-20 21:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-20 19:26 [PATCH v2] powerpc: booke_wdt: Fix build error as a module Pranith Kumar
2014-08-20 20:10 ` Guenter Roeck
2014-08-20 20:19 ` Pranith Kumar
2014-08-20 21:31 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).