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 @@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
......@@ -55,7 +56,7 @@ static int nowayout = 1;
static int nowayout = 0;
#endif
MODULE_PARM(nowayout,"i");
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
/*
......
......@@ -38,6 +38,7 @@
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/moduleparam.h>
#include <linux/pci.h>
#include <asm/io.h>
......@@ -79,7 +80,7 @@ static int nowayout = 1;
static int nowayout = 0;
#endif
MODULE_PARM(nowayout,"i");
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
/*
......
......@@ -42,6 +42,7 @@
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/moduleparam.h>
#include <asm/io.h>
#include <asm/uaccess.h>
......@@ -122,7 +123,7 @@ static int nowayout = 1;
static int nowayout = 0;
#endif
MODULE_PARM(nowayout,"i");
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
......
......@@ -20,6 +20,7 @@
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/init.h>
#include <linux/moduleparam.h>
#include <asm/uaccess.h>
#include <asm/sgi/sgimc.h>
......@@ -33,7 +34,7 @@ static int nowayout = 1;
static int nowayout = 0;
#endif
MODULE_PARM(nowayout,"i");
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
static void indydog_ping()
......
......@@ -30,6 +30,7 @@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/timer.h>
#include <linux/jiffies.h>
......@@ -97,8 +98,6 @@ static unsigned short zf_readb(unsigned char port)
MODULE_AUTHOR("Fernando Fuganti <fuganti@conectiva.com.br>");
MODULE_DESCRIPTION("MachZ ZF-Logic Watchdog driver");
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
static int nowayout = 1;
......@@ -106,7 +105,7 @@ static int nowayout = 1;
static int nowayout = 0;
#endif
MODULE_PARM(nowayout,"i");
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
#define PFX "machzwd"
......@@ -127,6 +126,9 @@ static struct watchdog_info zf_info = {
* defaults to GEN_RESET (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_is_open = 0;
static int zf_expect_close = 0;
......
......@@ -36,6 +36,7 @@
#define VERSION "0.5"
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/config.h>
#include <linux/types.h>
#include <linux/miscdevice.h>
......@@ -67,7 +68,7 @@ static int nowayout = 1;
static int nowayout = 0;
#endif
MODULE_PARM(nowayout,"i");
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
static void mixcomwd_ping(void)
......
......@@ -45,6 +45,7 @@
*/
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/timer.h>
#include <linux/config.h>
......@@ -87,7 +88,7 @@ static int timeout_val = WD_TIMEOUT;
static int timeout = 2;
static int expect_close = 0;
MODULE_PARM(timeout,"i");
module_param(timeout, int, 0);
MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds (default=2)");
#ifdef CONFIG_WATCHDOG_NOWAYOUT
......@@ -96,7 +97,7 @@ static int nowayout = 1;
static int nowayout = 0;
#endif
MODULE_PARM(nowayout,"i");
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
......
......@@ -19,6 +19,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/fs.h>
......@@ -208,9 +209,11 @@ module_exit(sa1100dog_exit);
MODULE_AUTHOR("Oleg Drokin <green@crimea.edu>");
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(nowayout, "i");
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started");
MODULE_LICENSE("GPL");
......@@ -56,6 +56,7 @@
*/
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/timer.h>
#include <linux/jiffies.h>
......@@ -111,7 +112,7 @@ static int nowayout = 1;
static int nowayout = 0;
#endif
MODULE_PARM(nowayout,"i");
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
/*
......
......@@ -49,6 +49,7 @@
*/
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/timer.h>
#include <linux/miscdevice.h>
......@@ -111,7 +112,7 @@ static int nowayout = 1;
static int nowayout = 0;
#endif
MODULE_PARM(nowayout,"i");
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
static spinlock_t wdt_spinlock;
......
......@@ -19,6 +19,7 @@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
......@@ -41,11 +42,11 @@ MODULE_LICENSE("GPL");
#endif
static int margin = 60; /* in seconds */
MODULE_PARM(margin, "i");
module_param(margin, int, 0);
MODULE_PARM_DESC(margin, "Watchdog margin in seconds");
static int nowayout = CONFIG_WATCHDOG_NOWAYOUT;
MODULE_PARM(nowayout, "i");
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Disable watchdog shutdown on close");
static u16 wdto_restart;
......
/*
* drivers/char/shwdt.c
* drivers/char/watchdog/shwdt.c
*
* Watchdog driver for integrated watchdog in the SuperH processors.
*
......@@ -19,6 +19,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/miscdevice.h>
......@@ -395,9 +396,11 @@ static void __exit sh_wdt_exit(void)
MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>");
MODULE_DESCRIPTION("SuperH watchdog driver");
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(nowayout,"i");
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
module_init(sh_wdt_init);
......
......@@ -37,6 +37,7 @@
*/
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/config.h>
#include <linux/types.h>
#include <linux/miscdevice.h>
......@@ -56,8 +57,8 @@ static int soft_noboot = 1;
static int soft_noboot = 0;
#endif /* ONLY_TESTING */
MODULE_PARM(soft_margin,"i");
MODULE_PARM(soft_noboot,"i");
module_param(soft_margin, int, 0);
module_param(soft_noboot, int, 0);
MODULE_LICENSE("GPL");
#ifdef CONFIG_WATCHDOG_NOWAYOUT
......@@ -66,7 +67,7 @@ static int nowayout = 1;
static int nowayout = 0;
#endif
MODULE_PARM(nowayout,"i");
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
/*
......
......@@ -27,6 +27,7 @@
*/
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/fs.h>
......@@ -63,7 +64,7 @@ static int nowayout = 1;
static int nowayout = 0;
#endif
MODULE_PARM(nowayout,"i");
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
static void wafwdt_ping(void)
......
......@@ -16,6 +16,7 @@
*/
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/fs.h>
......@@ -222,7 +223,7 @@ MODULE_AUTHOR("Phil Blundell <pb@nexus.co.uk>");
MODULE_DESCRIPTION("Footbridge watchdog driver");
MODULE_LICENSE("GPL");
MODULE_PARM(soft_margin,"i");
module_param(soft_margin, int, 0);
MODULE_PARM_DESC(soft_margin,"Watchdog timeout in seconds");
module_init(footbridge_watchdog_init);
......
......@@ -21,6 +21,7 @@
*/
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/config.h>
#include <linux/types.h>
#include <linux/kernel.h>
......@@ -44,9 +45,9 @@ static unsigned long timer_alive;
static int testmode;
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(testmode, "i");
module_param(testmode, int, 0);
MODULE_PARM_DESC(testmode,"Watchdog testmode (1 = no reboot), default=0");
#ifdef CONFIG_WATCHDOG_NOWAYOUT
......@@ -55,7 +56,7 @@ static int nowayout = 1;
static int nowayout = 0;
#endif
MODULE_PARM(nowayout,"i");
module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
......
......@@ -38,6 +38,7 @@
#include <linux/config.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
......@@ -88,7 +89,7 @@ static int nowayout = 1;
static int nowayout = 0;
#endif
MODULE_PARM(nowayout,"i");
module_param(nowayout, int, 0);
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