From 2083df327644741e00c07c2aa71ffdd3d659a338 Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Mon, 12 Mar 2012 09:51:56 +0530 Subject: [PATCH] --- yaml --- r: 309383 b: refs/heads/master c: 257f8c4aae392654d4ab846030b9f4518f16ed32 h: refs/heads/master i: 309381: 103e403512ccb1cc1d82b937a42c739d6b46c9c5 309379: 0e6b103f2cce38df1bcaacf01c0204341c92260a 309375: e94504f4400576b4551cf2724a14f520544c31b7 v: v3 --- [refs] | 2 +- trunk/drivers/watchdog/via_wdt.c | 2 +- trunk/drivers/watchdog/watchdog_dev.c | 6 +++--- trunk/include/linux/watchdog.h | 6 ++++++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 0be9afcd6611..4a91d48bb9e7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 09a46e739780aab2eadf47afdefa70c9cd69d83d +refs/heads/master: 257f8c4aae392654d4ab846030b9f4518f16ed32 diff --git a/trunk/drivers/watchdog/via_wdt.c b/trunk/drivers/watchdog/via_wdt.c index 5603e31afdab..aa50da3ccfe3 100644 --- a/trunk/drivers/watchdog/via_wdt.c +++ b/trunk/drivers/watchdog/via_wdt.c @@ -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 diff --git a/trunk/drivers/watchdog/watchdog_dev.c b/trunk/drivers/watchdog/watchdog_dev.c index 6c18a58cfd17..930cc7c87457 100644 --- a/trunk/drivers/watchdog/watchdog_dev.c +++ b/trunk/drivers/watchdog/watchdog_dev.c @@ -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 @@ -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; @@ -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; diff --git a/trunk/include/linux/watchdog.h b/trunk/include/linux/watchdog.h index ac40716b44e9..1984ea610577 100644 --- a/trunk/include/linux/watchdog.h +++ b/trunk/include/linux/watchdog.h @@ -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) {