Skip to content

Commit cb7efc0

Browse files
bigguinessWim Van Sebroeck
authored and
Wim Van Sebroeck
committed
watchdog: WatchDog Timer Driver Core - use passed watchdog_device
Use the passed watchdog_device instead of the static global variable when testing and setting the status in watchdog_ping, watchdog_start, and watchdog_stop. Note that the callers of these functions are actually passing the static global variable. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
1 parent 9d037a7 commit cb7efc0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/watchdog/watchdog_dev.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static struct watchdog_device *wdd;
5959

6060
static int watchdog_ping(struct watchdog_device *wddev)
6161
{
62-
if (test_bit(WDOG_ACTIVE, &wdd->status)) {
62+
if (test_bit(WDOG_ACTIVE, &wddev->status)) {
6363
if (wddev->ops->ping)
6464
return wddev->ops->ping(wddev); /* ping the watchdog */
6565
else
@@ -81,12 +81,12 @@ static int watchdog_start(struct watchdog_device *wddev)
8181
{
8282
int err;
8383

84-
if (!test_bit(WDOG_ACTIVE, &wdd->status)) {
84+
if (!test_bit(WDOG_ACTIVE, &wddev->status)) {
8585
err = wddev->ops->start(wddev);
8686
if (err < 0)
8787
return err;
8888

89-
set_bit(WDOG_ACTIVE, &wdd->status);
89+
set_bit(WDOG_ACTIVE, &wddev->status);
9090
}
9191
return 0;
9292
}
@@ -105,18 +105,18 @@ static int watchdog_stop(struct watchdog_device *wddev)
105105
{
106106
int err = -EBUSY;
107107

108-
if (test_bit(WDOG_NO_WAY_OUT, &wdd->status)) {
108+
if (test_bit(WDOG_NO_WAY_OUT, &wddev->status)) {
109109
pr_info("%s: nowayout prevents watchdog to be stopped!\n",
110-
wdd->info->identity);
110+
wddev->info->identity);
111111
return err;
112112
}
113113

114-
if (test_bit(WDOG_ACTIVE, &wdd->status)) {
114+
if (test_bit(WDOG_ACTIVE, &wddev->status)) {
115115
err = wddev->ops->stop(wddev);
116116
if (err < 0)
117117
return err;
118118

119-
clear_bit(WDOG_ACTIVE, &wdd->status);
119+
clear_bit(WDOG_ACTIVE, &wddev->status);
120120
}
121121
return 0;
122122
}

0 commit comments

Comments
 (0)