Commit 76550d32 authored by Randy Dunlap's avatar Randy Dunlap Committed by Wim Van Sebroeck

watchdog: fix several MODULE_PARM_DESC strings

Fix MODULE_PARM_DESC() strings in several watchdog drivers.
Some are simple as add a parenthesis.
Others are problems from __stringify() being used on a
variable name instead of a macro name, so the variable name
is produced in the string instead of its build-time value.
In these cases, create a macro for the value so that the
module param description string is useful.

Only pc87413_wdt has been built (due to toolchains).
Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent 42bd5d49
...@@ -53,7 +53,7 @@ static int mpc8xxx_wdt_init_late(void); ...@@ -53,7 +53,7 @@ static int mpc8xxx_wdt_init_late(void);
static u16 timeout = 0xffff; static u16 timeout = 0xffff;
module_param(timeout, ushort, 0); module_param(timeout, ushort, 0);
MODULE_PARM_DESC(timeout, MODULE_PARM_DESC(timeout,
"Watchdog timeout in ticks. (0<timeout<65536, default=65535"); "Watchdog timeout in ticks. (0<timeout<65536, default=65535)");
static int reset = 1; static int reset = 1;
module_param(reset, bool, 0); module_param(reset, bool, 0);
......
...@@ -53,7 +53,9 @@ ...@@ -53,7 +53,9 @@
#define WDTO 0x11 /* Watchdog timeout register */ #define WDTO 0x11 /* Watchdog timeout register */
#define WDCFG 0x12 /* Watchdog config register */ #define WDCFG 0x12 /* Watchdog config register */
static int io = 0x2E; /* Address used on Portwell Boards */ #define IO_DEFAULT 0x2E /* Address used on Portwell Boards */
static int io = IO_DEFAULT;
static int timeout = DEFAULT_TIMEOUT; /* timeout value */ static int timeout = DEFAULT_TIMEOUT; /* timeout value */
static unsigned long timer_enabled; /* is the timer enabled? */ static unsigned long timer_enabled; /* is the timer enabled? */
...@@ -583,12 +585,13 @@ MODULE_LICENSE("GPL"); ...@@ -583,12 +585,13 @@ MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
module_param(io, int, 0); module_param(io, int, 0);
MODULE_PARM_DESC(io, MODNAME " I/O port (default: " __MODULE_STRING(io) ")."); MODULE_PARM_DESC(io, MODNAME " I/O port (default: "
__MODULE_STRING(IO_DEFAULT) ").");
module_param(timeout, int, 0); module_param(timeout, int, 0);
MODULE_PARM_DESC(timeout, MODULE_PARM_DESC(timeout,
"Watchdog timeout in minutes (default=" "Watchdog timeout in minutes (default="
__MODULE_STRING(timeout) ")."); __MODULE_STRING(DEFAULT_TIMEOUT) ").");
module_param(nowayout, int, 0); module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, MODULE_PARM_DESC(nowayout,
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#define PFX "pnx833x: " #define PFX "pnx833x: "
#define WATCHDOG_TIMEOUT 30 /* 30 sec Maximum timeout */ #define WATCHDOG_TIMEOUT 30 /* 30 sec Maximum timeout */
#define WATCHDOG_COUNT_FREQUENCY 68000000U /* Watchdog counts at 68MHZ. */ #define WATCHDOG_COUNT_FREQUENCY 68000000U /* Watchdog counts at 68MHZ. */
#define PNX_WATCHDOG_TIMEOUT (WATCHDOG_TIMEOUT * WATCHDOG_COUNT_FREQUENCY)
#define PNX_TIMEOUT_VALUE 2040000000U
/** CONFIG block */ /** CONFIG block */
#define PNX833X_CONFIG (0x07000U) #define PNX833X_CONFIG (0x07000U)
...@@ -47,20 +49,21 @@ ...@@ -47,20 +49,21 @@
static int pnx833x_wdt_alive; static int pnx833x_wdt_alive;
/* Set default timeout in MHZ.*/ /* Set default timeout in MHZ.*/
static int pnx833x_wdt_timeout = (WATCHDOG_TIMEOUT * WATCHDOG_COUNT_FREQUENCY); static int pnx833x_wdt_timeout = PNX_WATCHDOG_TIMEOUT;
module_param(pnx833x_wdt_timeout, int, 0); module_param(pnx833x_wdt_timeout, int, 0);
MODULE_PARM_DESC(timeout, "Watchdog timeout in Mhz. (68Mhz clock), default=" MODULE_PARM_DESC(timeout, "Watchdog timeout in Mhz. (68Mhz clock), default="
__MODULE_STRING(pnx833x_wdt_timeout) "(30 seconds)."); __MODULE_STRING(PNX_TIMEOUT_VALUE) "(30 seconds).");
static int nowayout = WATCHDOG_NOWAYOUT; static int nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, int, 0); module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
static int start_enabled = 1; #define START_DEFAULT 1
static int start_enabled = START_DEFAULT;
module_param(start_enabled, int, 0); module_param(start_enabled, int, 0);
MODULE_PARM_DESC(start_enabled, "Watchdog is started on module insertion " MODULE_PARM_DESC(start_enabled, "Watchdog is started on module insertion "
"(default=" __MODULE_STRING(start_enabled) ")"); "(default=" __MODULE_STRING(START_DEFAULT) ")");
static void pnx833x_wdt_start(void) static void pnx833x_wdt_start(void)
{ {
......
...@@ -63,7 +63,7 @@ module_param(nowayout, int, 0); ...@@ -63,7 +63,7 @@ module_param(nowayout, int, 0);
module_param(soft_noboot, int, 0); module_param(soft_noboot, int, 0);
module_param(debug, int, 0); module_param(debug, int, 0);
MODULE_PARM_DESC(tmr_margin, "Watchdog tmr_margin in seconds. default=" MODULE_PARM_DESC(tmr_margin, "Watchdog tmr_margin in seconds. (default="
__MODULE_STRING(CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME) ")"); __MODULE_STRING(CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME) ")");
MODULE_PARM_DESC(tmr_atboot, MODULE_PARM_DESC(tmr_atboot,
"Watchdog is started at boot time if set to 1, default=" "Watchdog is started at boot time if set to 1, default="
...@@ -71,8 +71,8 @@ MODULE_PARM_DESC(tmr_atboot, ...@@ -71,8 +71,8 @@ MODULE_PARM_DESC(tmr_atboot,
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
MODULE_PARM_DESC(soft_noboot, "Watchdog action, set to 1 to ignore reboots, " MODULE_PARM_DESC(soft_noboot, "Watchdog action, set to 1 to ignore reboots, "
"0 to reboot (default depends on ONLY_TESTING)"); "0 to reboot (default 0)");
MODULE_PARM_DESC(debug, "Watchdog debug, set to >1 for debug, (default 0)"); MODULE_PARM_DESC(debug, "Watchdog debug, set to >1 for debug (default 0)");
static unsigned long open_lock; static unsigned long open_lock;
static struct device *wdt_dev; /* platform device attached to */ static struct device *wdt_dev; /* platform device attached to */
......
...@@ -496,7 +496,7 @@ MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); ...@@ -496,7 +496,7 @@ MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
module_param(clock_division_ratio, int, 0); module_param(clock_division_ratio, int, 0);
MODULE_PARM_DESC(clock_division_ratio, MODULE_PARM_DESC(clock_division_ratio,
"Clock division ratio. Valid ranges are from 0x5 (1.31ms) " "Clock division ratio. Valid ranges are from 0x5 (1.31ms) "
"to 0x7 (5.25ms). (default=" __MODULE_STRING(clock_division_ratio) ")"); "to 0x7 (5.25ms). (default=" __MODULE_STRING(WTCSR_CKS_4096) ")");
module_param(heartbeat, int, 0); module_param(heartbeat, int, 0);
MODULE_PARM_DESC(heartbeat, MODULE_PARM_DESC(heartbeat,
......
...@@ -63,7 +63,7 @@ static char expect_close; ...@@ -63,7 +63,7 @@ static char expect_close;
static DEFINE_SPINLOCK(spinlock); static DEFINE_SPINLOCK(spinlock);
module_param(timeout, int, 0); module_param(timeout, int, 0);
MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds (60..15300), default=" MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds (60..15300, default="
__MODULE_STRING(DEFAULT_TIMEOUT) ")"); __MODULE_STRING(DEFAULT_TIMEOUT) ")");
module_param(testmode, int, 0); 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");
......
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