]> Pileus Git - ~andy/linux/blobdiff - include/linux/watchdog.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
[~andy/linux] / include / linux / watchdog.h
index 111843f88b2a97dc87434631335ab95b6e786b45..43ba5b3ce2a3ac6be68b8aacd2b3740953113b25 100644 (file)
@@ -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)
 {