From 257f8c4aae392654d4ab846030b9f4518f16ed32 Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Mon, 12 Mar 2012 09:51:56 +0530 Subject: watchdog: Add watchdog_active() routine Some watchdog may need to check if watchdog is ACTIVE or not, for example in their suspend/resume hooks. This patch adds this routine and changes the core drivers to use it. Signed-off-by: Viresh Kumar Signed-off-by: Wim Van Sebroeck --- include/linux/watchdog.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/linux/watchdog.h') diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h index ac40716b44e9..1984ea610577 100644 --- a/include/linux/watchdog.h +++ b/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) { -- cgit v1.2.3