Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309383
b: refs/heads/master
c: 257f8c4
h: refs/heads/master
i:
  309381: 103e403
  309379: 0e6b103
  309375: e94504f
v: v3
  • Loading branch information
Viresh Kumar authored and Wim Van Sebroeck committed May 30, 2012
1 parent 2245a97 commit 2083df3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 09a46e739780aab2eadf47afdefa70c9cd69d83d
refs/heads/master: 257f8c4aae392654d4ab846030b9f4518f16ed32
2 changes: 1 addition & 1 deletion trunk/drivers/watchdog/via_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static inline void wdt_reset(void)
static void wdt_timer_tick(unsigned long data)
{
if (time_before(jiffies, next_heartbeat) ||
(!test_bit(WDOG_ACTIVE, &wdt_dev.status))) {
(!watchdog_active(&wdt_dev))) {
wdt_reset();
mod_timer(&timer, jiffies + WDT_HEARTBEAT);
} else
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/watchdog/watchdog_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static struct watchdog_device *wdd;

static int watchdog_ping(struct watchdog_device *wddev)
{
if (test_bit(WDOG_ACTIVE, &wddev->status)) {
if (watchdog_active(wddev)) {
if (wddev->ops->ping)
return wddev->ops->ping(wddev); /* ping the watchdog */
else
Expand All @@ -83,7 +83,7 @@ static int watchdog_start(struct watchdog_device *wddev)
{
int err;

if (!test_bit(WDOG_ACTIVE, &wddev->status)) {
if (!watchdog_active(wddev)) {
err = wddev->ops->start(wddev);
if (err < 0)
return err;
Expand Down Expand Up @@ -113,7 +113,7 @@ static int watchdog_stop(struct watchdog_device *wddev)
return err;
}

if (test_bit(WDOG_ACTIVE, &wddev->status)) {
if (watchdog_active(wddev)) {
err = wddev->ops->stop(wddev);
if (err < 0)
return err;
Expand Down
6 changes: 6 additions & 0 deletions trunk/include/linux/watchdog.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ struct watchdog_device {
#define WATCHDOG_NOWAYOUT_INIT_STATUS 0
#endif

/* Use the following function to check wether or not the watchdog is active */
static inline bool watchdog_active(struct watchdog_device *wdd)
{
return test_bit(WDOG_ACTIVE, &wdd->status);
}

/* Use the following function to set the nowayout feature */
static inline void watchdog_set_nowayout(struct watchdog_device *wdd, bool nowayout)
{
Expand Down

0 comments on commit 2083df3

Please sign in to comment.