* [PATCH] watchdog: WatchDog Timer Driver Core - use passed watchdog_device
@ 2011-08-03 22:38 H Hartley Sweeten
2011-08-04 18:07 ` Wim Van Sebroeck
0 siblings, 1 reply; 2+ messages in thread
From: H Hartley Sweeten @ 2011-08-03 22:38 UTC (permalink / raw)
To: Linux Kernel; +Cc: linux-watchdog, wim
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>
Cc: Wim Van Sebroeck <wim@iguana.be>
---
diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c
index d33520d..1199da0f 100644
--- a/drivers/watchdog/watchdog_dev.c
+++ b/drivers/watchdog/watchdog_dev.c
@@ -59,7 +59,7 @@ static struct watchdog_device *wdd;
static int watchdog_ping(struct watchdog_device *wddev)
{
- if (test_bit(WDOG_ACTIVE, &wdd->status)) {
+ if (test_bit(WDOG_ACTIVE, &wddev->status)) {
if (wddev->ops->ping)
return wddev->ops->ping(wddev); /* ping the watchdog */
else
@@ -81,12 +81,12 @@ static int watchdog_start(struct watchdog_device *wddev)
{
int err;
- if (!test_bit(WDOG_ACTIVE, &wdd->status)) {
+ if (!test_bit(WDOG_ACTIVE, &wddev->status)) {
err = wddev->ops->start(wddev);
if (err < 0)
return err;
- set_bit(WDOG_ACTIVE, &wdd->status);
+ set_bit(WDOG_ACTIVE, &wddev->status);
}
return 0;
}
@@ -105,18 +105,18 @@ static int watchdog_stop(struct watchdog_device *wddev)
{
int err = -EBUSY;
- if (test_bit(WDOG_NO_WAY_OUT, &wdd->status)) {
+ if (test_bit(WDOG_NO_WAY_OUT, &wddev->status)) {
pr_info("%s: nowayout prevents watchdog to be stopped!\n",
- wdd->info->identity);
+ wddev->info->identity);
return err;
}
- if (test_bit(WDOG_ACTIVE, &wdd->status)) {
+ if (test_bit(WDOG_ACTIVE, &wddev->status)) {
err = wddev->ops->stop(wddev);
if (err < 0)
return err;
- clear_bit(WDOG_ACTIVE, &wdd->status);
+ clear_bit(WDOG_ACTIVE, &wddev->status);
}
return 0;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] watchdog: WatchDog Timer Driver Core - use passed watchdog_device
2011-08-03 22:38 [PATCH] watchdog: WatchDog Timer Driver Core - use passed watchdog_device H Hartley Sweeten
@ 2011-08-04 18:07 ` Wim Van Sebroeck
0 siblings, 0 replies; 2+ messages in thread
From: Wim Van Sebroeck @ 2011-08-04 18:07 UTC (permalink / raw)
To: H Hartley Sweeten; +Cc: Linux Kernel, linux-watchdog
Hi H Hartley,
> 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>
> Cc: Wim Van Sebroeck <wim@iguana.be>
This will be added. We will need this when we go to the sysfs part of the core anyway.
Kind regards,
Wim.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-08-04 18:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-03 22:38 [PATCH] watchdog: WatchDog Timer Driver Core - use passed watchdog_device H Hartley Sweeten
2011-08-04 18:07 ` Wim Van Sebroeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®