Commit 3420e0e6 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Watchdog: use module_param

From: Wim Van Sebroeck <wim@iguana.be>

The first patch convert these watchdog modules to the new module_param syntax.

The second patch fixes machzwd.c (you need to declare the variable before
using the module_param subroutine).
parent 9c2a5b7c
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/watchdog.h> #include <linux/watchdog.h>
...@@ -55,7 +56,7 @@ static int nowayout = 1; ...@@ -55,7 +56,7 @@ static int nowayout = 1;
static int nowayout = 0; static int nowayout = 0;
#endif #endif
MODULE_PARM(nowayout,"i"); module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
/* /*
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <linux/notifier.h> #include <linux/notifier.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/moduleparam.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -79,7 +80,7 @@ static int nowayout = 1; ...@@ -79,7 +80,7 @@ static int nowayout = 1;
static int nowayout = 0; static int nowayout = 0;
#endif #endif
MODULE_PARM(nowayout,"i"); module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
/* /*
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/moduleparam.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -122,7 +123,7 @@ static int nowayout = 1; ...@@ -122,7 +123,7 @@ static int nowayout = 1;
static int nowayout = 0; static int nowayout = 0;
#endif #endif
MODULE_PARM(nowayout,"i"); module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/watchdog.h> #include <linux/watchdog.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/moduleparam.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/sgi/sgimc.h> #include <asm/sgi/sgimc.h>
...@@ -33,7 +34,7 @@ static int nowayout = 1; ...@@ -33,7 +34,7 @@ static int nowayout = 1;
static int nowayout = 0; static int nowayout = 0;
#endif #endif
MODULE_PARM(nowayout,"i"); module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
static void indydog_ping() static void indydog_ping()
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/jiffies.h> #include <linux/jiffies.h>
...@@ -97,8 +98,6 @@ static unsigned short zf_readb(unsigned char port) ...@@ -97,8 +98,6 @@ static unsigned short zf_readb(unsigned char port)
MODULE_AUTHOR("Fernando Fuganti <fuganti@conectiva.com.br>"); MODULE_AUTHOR("Fernando Fuganti <fuganti@conectiva.com.br>");
MODULE_DESCRIPTION("MachZ ZF-Logic Watchdog driver"); MODULE_DESCRIPTION("MachZ ZF-Logic Watchdog driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_PARM(action, "i");
MODULE_PARM_DESC(action, "after watchdog resets, generate: 0 = RESET(*) 1 = SMI 2 = NMI 3 = SCI");
#ifdef CONFIG_WATCHDOG_NOWAYOUT #ifdef CONFIG_WATCHDOG_NOWAYOUT
static int nowayout = 1; static int nowayout = 1;
...@@ -106,7 +105,7 @@ static int nowayout = 1; ...@@ -106,7 +105,7 @@ static int nowayout = 1;
static int nowayout = 0; static int nowayout = 0;
#endif #endif
MODULE_PARM(nowayout,"i"); module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
#define PFX "machzwd" #define PFX "machzwd"
...@@ -127,6 +126,9 @@ static struct watchdog_info zf_info = { ...@@ -127,6 +126,9 @@ static struct watchdog_info zf_info = {
* defaults to GEN_RESET (0) * defaults to GEN_RESET (0)
*/ */
static int action = 0; static int action = 0;
module_param(action, int, 0);
MODULE_PARM_DESC(action, "after watchdog resets, generate: 0 = RESET(*) 1 = SMI 2 = NMI 3 = SCI");
static int zf_action = GEN_RESET; static int zf_action = GEN_RESET;
static int zf_is_open = 0; static int zf_is_open = 0;
static int zf_expect_close = 0; static int zf_expect_close = 0;
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#define VERSION "0.5" #define VERSION "0.5"
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/config.h> #include <linux/config.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
...@@ -67,7 +68,7 @@ static int nowayout = 1; ...@@ -67,7 +68,7 @@ static int nowayout = 1;
static int nowayout = 0; static int nowayout = 0;
#endif #endif
MODULE_PARM(nowayout,"i"); module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
static void mixcomwd_ping(void) static void mixcomwd_ping(void)
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/config.h> #include <linux/config.h>
...@@ -87,7 +88,7 @@ static int timeout_val = WD_TIMEOUT; ...@@ -87,7 +88,7 @@ static int timeout_val = WD_TIMEOUT;
static int timeout = 2; static int timeout = 2;
static int expect_close = 0; static int expect_close = 0;
MODULE_PARM(timeout,"i"); module_param(timeout, int, 0);
MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds (default=2)"); MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds (default=2)");
#ifdef CONFIG_WATCHDOG_NOWAYOUT #ifdef CONFIG_WATCHDOG_NOWAYOUT
...@@ -96,7 +97,7 @@ static int nowayout = 1; ...@@ -96,7 +97,7 @@ static int nowayout = 1;
static int nowayout = 0; static int nowayout = 0;
#endif #endif
MODULE_PARM(nowayout,"i"); module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/fs.h> #include <linux/fs.h>
...@@ -208,9 +209,11 @@ module_exit(sa1100dog_exit); ...@@ -208,9 +209,11 @@ module_exit(sa1100dog_exit);
MODULE_AUTHOR("Oleg Drokin <green@crimea.edu>"); MODULE_AUTHOR("Oleg Drokin <green@crimea.edu>");
MODULE_DESCRIPTION("SA1100 Watchdog"); MODULE_DESCRIPTION("SA1100 Watchdog");
MODULE_PARM(margin,"i");
module_param(margin, int, 0);
MODULE_PARM_DESC(margin, "Watchdog margin in seconds (default 60s)"); MODULE_PARM_DESC(margin, "Watchdog margin in seconds (default 60s)");
MODULE_PARM(nowayout, "i"); module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started"); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/jiffies.h> #include <linux/jiffies.h>
...@@ -111,7 +112,7 @@ static int nowayout = 1; ...@@ -111,7 +112,7 @@ static int nowayout = 1;
static int nowayout = 0; static int nowayout = 0;
#endif #endif
MODULE_PARM(nowayout,"i"); module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
/* /*
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
...@@ -111,7 +112,7 @@ static int nowayout = 1; ...@@ -111,7 +112,7 @@ static int nowayout = 1;
static int nowayout = 0; static int nowayout = 0;
#endif #endif
MODULE_PARM(nowayout,"i"); module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
static spinlock_t wdt_spinlock; static spinlock_t wdt_spinlock;
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/watchdog.h> #include <linux/watchdog.h>
...@@ -41,11 +42,11 @@ MODULE_LICENSE("GPL"); ...@@ -41,11 +42,11 @@ MODULE_LICENSE("GPL");
#endif #endif
static int margin = 60; /* in seconds */ static int margin = 60; /* in seconds */
MODULE_PARM(margin, "i"); module_param(margin, int, 0);
MODULE_PARM_DESC(margin, "Watchdog margin in seconds"); MODULE_PARM_DESC(margin, "Watchdog margin in seconds");
static int nowayout = CONFIG_WATCHDOG_NOWAYOUT; static int nowayout = CONFIG_WATCHDOG_NOWAYOUT;
MODULE_PARM(nowayout, "i"); module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Disable watchdog shutdown on close"); MODULE_PARM_DESC(nowayout, "Disable watchdog shutdown on close");
static u16 wdto_restart; static u16 wdto_restart;
......
/* /*
* drivers/char/shwdt.c * drivers/char/watchdog/shwdt.c
* *
* Watchdog driver for integrated watchdog in the SuperH processors. * Watchdog driver for integrated watchdog in the SuperH processors.
* *
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
...@@ -395,9 +396,11 @@ static void __exit sh_wdt_exit(void) ...@@ -395,9 +396,11 @@ static void __exit sh_wdt_exit(void)
MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>"); MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>");
MODULE_DESCRIPTION("SuperH watchdog driver"); MODULE_DESCRIPTION("SuperH watchdog driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_PARM(clock_division_ratio, "i");
module_param(clock_division_ratio, int, 0);
MODULE_PARM_DESC(clock_division_ratio, "Clock division ratio. Valid ranges are from 0x5 (1.31ms) to 0x7 (5.25ms). Defaults to 0x7."); MODULE_PARM_DESC(clock_division_ratio, "Clock division ratio. Valid ranges are from 0x5 (1.31ms) to 0x7 (5.25ms). Defaults to 0x7.");
MODULE_PARM(nowayout,"i");
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
module_init(sh_wdt_init); module_init(sh_wdt_init);
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/config.h> #include <linux/config.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
...@@ -56,8 +57,8 @@ static int soft_noboot = 1; ...@@ -56,8 +57,8 @@ static int soft_noboot = 1;
static int soft_noboot = 0; static int soft_noboot = 0;
#endif /* ONLY_TESTING */ #endif /* ONLY_TESTING */
MODULE_PARM(soft_margin,"i"); module_param(soft_margin, int, 0);
MODULE_PARM(soft_noboot,"i"); module_param(soft_noboot, int, 0);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
#ifdef CONFIG_WATCHDOG_NOWAYOUT #ifdef CONFIG_WATCHDOG_NOWAYOUT
...@@ -66,7 +67,7 @@ static int nowayout = 1; ...@@ -66,7 +67,7 @@ static int nowayout = 1;
static int nowayout = 0; static int nowayout = 0;
#endif #endif
MODULE_PARM(nowayout,"i"); module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
/* /*
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/watchdog.h> #include <linux/watchdog.h>
#include <linux/fs.h> #include <linux/fs.h>
...@@ -63,7 +64,7 @@ static int nowayout = 1; ...@@ -63,7 +64,7 @@ static int nowayout = 1;
static int nowayout = 0; static int nowayout = 0;
#endif #endif
MODULE_PARM(nowayout,"i"); module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
static void wafwdt_ping(void) static void wafwdt_ping(void)
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/fs.h> #include <linux/fs.h>
...@@ -222,7 +223,7 @@ MODULE_AUTHOR("Phil Blundell <pb@nexus.co.uk>"); ...@@ -222,7 +223,7 @@ MODULE_AUTHOR("Phil Blundell <pb@nexus.co.uk>");
MODULE_DESCRIPTION("Footbridge watchdog driver"); MODULE_DESCRIPTION("Footbridge watchdog driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_PARM(soft_margin,"i"); module_param(soft_margin, int, 0);
MODULE_PARM_DESC(soft_margin,"Watchdog timeout in seconds"); MODULE_PARM_DESC(soft_margin,"Watchdog timeout in seconds");
module_init(footbridge_watchdog_init); module_init(footbridge_watchdog_init);
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/config.h> #include <linux/config.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -44,9 +45,9 @@ static unsigned long timer_alive; ...@@ -44,9 +45,9 @@ static unsigned long timer_alive;
static int testmode; static int testmode;
static int expect_close = 0; static int expect_close = 0;
MODULE_PARM(timeout, "i"); module_param(timeout, int, 0);
MODULE_PARM_DESC(timeout,"Watchdog timeout in seconds (60..15300), default=60"); MODULE_PARM_DESC(timeout,"Watchdog timeout in seconds (60..15300), default=60");
MODULE_PARM(testmode, "i"); module_param(testmode, int, 0);
MODULE_PARM_DESC(testmode,"Watchdog testmode (1 = no reboot), default=0"); MODULE_PARM_DESC(testmode,"Watchdog testmode (1 = no reboot), default=0");
#ifdef CONFIG_WATCHDOG_NOWAYOUT #ifdef CONFIG_WATCHDOG_NOWAYOUT
...@@ -55,7 +56,7 @@ static int nowayout = 1; ...@@ -55,7 +56,7 @@ static int nowayout = 1;
static int nowayout = 0; static int nowayout = 0;
#endif #endif
MODULE_PARM(nowayout,"i"); module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/watchdog.h> #include <linux/watchdog.h>
...@@ -88,7 +89,7 @@ static int nowayout = 1; ...@@ -88,7 +89,7 @@ static int nowayout = 1;
static int nowayout = 0; static int nowayout = 0;
#endif #endif
MODULE_PARM(nowayout,"i"); module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment