summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 18:29:23 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 18:29:23 (GMT)
commit88266917b518e2ca954d85983470592aaaf82993 (patch)
treee8c6e77cf6c70de0dbe655ce3cd4401391a06b6e /include
parent269d430131b699c2cadf58495f025a4092959ef5 (diff)
parente2bf7c4c22939bd83814d8da40a352d246030b1b (diff)
downloadlinux-88266917b518e2ca954d85983470592aaaf82993.tar.xz
Merge git://www.linux-watchdog.org/linux-watchdog
* git://www.linux-watchdog.org/linux-watchdog: watchdog: omap_wdt.c: fix the WDIOC_GETBOOTSTATUS ioctl if not implemented. watchdog: new driver for VIA chipsets watchdog: ath79_wdt: flush register writes drivers/watchdog/lantiq_wdt.c: drop iounmap for devm_ allocated data watchdog: documentation: describe nowayout in coversion-guide watchdog: documentation: update index file watchdog: Convert wm831x driver to devm_kzalloc() watchdog: add nowayout helpers to Watchdog Timer Driver Kernel API watchdog: convert drivers/watchdog/* to use module_platform_driver() watchdog: Use DEFINE_SPINLOCK() for static spinlocks watchdog: Convert Wolfson drivers to module_platform_driver
Diffstat (limited to 'include')
-rw-r--r--include/linux/watchdog.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
index 111843f..43ba5b3c 100644
--- a/include/linux/watchdog.h
+++ b/include/linux/watchdog.h
@@ -53,11 +53,7 @@ struct watchdog_info {
#ifdef __KERNEL__
-#ifdef CONFIG_WATCHDOG_NOWAYOUT
-#define WATCHDOG_NOWAYOUT 1
-#else
-#define WATCHDOG_NOWAYOUT 0
-#endif
+#include <linux/bitops.h>
struct watchdog_ops;
struct watchdog_device;
@@ -122,6 +118,21 @@ struct watchdog_device {
#define WDOG_NO_WAY_OUT 3 /* Is 'nowayout' feature set ? */
};
+#ifdef CONFIG_WATCHDOG_NOWAYOUT
+#define WATCHDOG_NOWAYOUT 1
+#define WATCHDOG_NOWAYOUT_INIT_STATUS (1 << WDOG_NO_WAY_OUT)
+#else
+#define WATCHDOG_NOWAYOUT 0
+#define WATCHDOG_NOWAYOUT_INIT_STATUS 0
+#endif
+
+/* Use the following function to set the nowayout feature */
+static inline void watchdog_set_nowayout(struct watchdog_device *wdd, int nowayout)
+{
+ if (nowayout)
+ set_bit(WDOG_NO_WAY_OUT, &wdd->status);
+}
+
/* Use the following functions to manipulate watchdog driver specific data */
static inline void watchdog_set_drvdata(struct watchdog_device *wdd, void *data)
{