Skip to content

Commit 156ad7f

Browse files
Yuechao Zhaogroeck
authored andcommitted
hwmon: (nct7904) Set default timeout
The timeout module parameter should not be used for setting the default timeout. Because, if you set the timeout = 0, the default timeout will be meaningless. And the timeout module parameter of 0 means "no timeout module parameter specified". Signed-off-by: Yuechao Zhao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
1 parent 59dd36f commit 156ad7f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/hwmon/nct7904.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,14 @@
111111
#define MIN_TIMEOUT (1 * 60)
112112
#define MAX_TIMEOUT (255 * 60)
113113

114-
static int timeout = WATCHDOG_TIMEOUT;
114+
static int timeout;
115115
module_param(timeout, int, 0);
116116
MODULE_PARM_DESC(timeout, "Watchdog timeout in minutes. 1 <= timeout <= 255, default="
117-
__MODULE_STRING(WATCHODOG_TIMEOUT) ".");
117+
__MODULE_STRING(WATCHDOG_TIMEOUT) ".");
118118

119119
static bool nowayout = WATCHDOG_NOWAYOUT;
120120
module_param(nowayout, bool, 0);
121-
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started once started (default="
121+
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
122122
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
123123

124124
static const unsigned short normal_i2c[] = {
@@ -1147,7 +1147,7 @@ static int nct7904_probe(struct i2c_client *client,
11471147
data->wdt.ops = &nct7904_wdt_ops;
11481148
data->wdt.info = &nct7904_wdt_info;
11491149

1150-
data->wdt.timeout = timeout * 60; /* in seconds */
1150+
data->wdt.timeout = WATCHDOG_TIMEOUT * 60; /* Set default timeout */
11511151
data->wdt.min_timeout = MIN_TIMEOUT;
11521152
data->wdt.max_timeout = MAX_TIMEOUT;
11531153
data->wdt.parent = &client->dev;

0 commit comments

Comments
 (0)