Skip to content

Commit 7ca6ee3

Browse files
westeriWolfram Sang
authored andcommitted
watchdog: iTCO_wdt: Export vendorsupport
In preparation for making ->smi_res optional the iTCO_wdt driver needs to know whether vendorsupport is being set to non-zero. For this reason export the variable. Signed-off-by: Mika Westerberg <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 2c523b3 commit 7ca6ee3

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

drivers/watchdog/iTCO_vendor.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
22
/* iTCO Vendor Specific Support hooks */
33
#ifdef CONFIG_ITCO_VENDOR_SUPPORT
4+
extern int iTCO_vendorsupport;
45
extern void iTCO_vendor_pre_start(struct resource *, unsigned int);
56
extern void iTCO_vendor_pre_stop(struct resource *);
67
extern int iTCO_vendor_check_noreboot_on(void);
78
#else
9+
#define iTCO_vendorsupport 0
810
#define iTCO_vendor_pre_start(acpibase, heartbeat) {}
911
#define iTCO_vendor_pre_stop(acpibase) {}
1012
#define iTCO_vendor_check_noreboot_on() 1

drivers/watchdog/iTCO_vendor_support.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@
3939
/* Broken BIOS */
4040
#define BROKEN_BIOS 911
4141

42-
static int vendorsupport;
43-
module_param(vendorsupport, int, 0);
42+
int iTCO_vendorsupport;
43+
EXPORT_SYMBOL(iTCO_vendorsupport);
44+
45+
module_param_named(vendorsupport, iTCO_vendorsupport, int, 0);
4446
MODULE_PARM_DESC(vendorsupport, "iTCO vendor specific support mode, default="
4547
"0 (none), 1=SuperMicro Pent3, 911=Broken SMI BIOS");
4648

@@ -152,7 +154,7 @@ static void broken_bios_stop(struct resource *smires)
152154
void iTCO_vendor_pre_start(struct resource *smires,
153155
unsigned int heartbeat)
154156
{
155-
switch (vendorsupport) {
157+
switch (iTCO_vendorsupport) {
156158
case SUPERMICRO_OLD_BOARD:
157159
supermicro_old_pre_start(smires);
158160
break;
@@ -165,7 +167,7 @@ EXPORT_SYMBOL(iTCO_vendor_pre_start);
165167

166168
void iTCO_vendor_pre_stop(struct resource *smires)
167169
{
168-
switch (vendorsupport) {
170+
switch (iTCO_vendorsupport) {
169171
case SUPERMICRO_OLD_BOARD:
170172
supermicro_old_pre_stop(smires);
171173
break;
@@ -178,7 +180,7 @@ EXPORT_SYMBOL(iTCO_vendor_pre_stop);
178180

179181
int iTCO_vendor_check_noreboot_on(void)
180182
{
181-
switch (vendorsupport) {
183+
switch (iTCO_vendorsupport) {
182184
case SUPERMICRO_OLD_BOARD:
183185
return 0;
184186
default:
@@ -189,13 +191,13 @@ EXPORT_SYMBOL(iTCO_vendor_check_noreboot_on);
189191

190192
static int __init iTCO_vendor_init_module(void)
191193
{
192-
if (vendorsupport == SUPERMICRO_NEW_BOARD) {
194+
if (iTCO_vendorsupport == SUPERMICRO_NEW_BOARD) {
193195
pr_warn("Option vendorsupport=%d is no longer supported, "
194196
"please use the w83627hf_wdt driver instead\n",
195197
SUPERMICRO_NEW_BOARD);
196198
return -EINVAL;
197199
}
198-
pr_info("vendor-support=%d\n", vendorsupport);
200+
pr_info("vendor-support=%d\n", iTCO_vendorsupport);
199201
return 0;
200202
}
201203

0 commit comments

Comments
 (0)