watchdog: add nowayout helpers to Watchdog Timer Driver Kernel API
Add two nowayout helpers for the Watchdog Timer Driver Kernel API. And apply this to the already converted drivers. Note: s3c2410_wdt lost the nowayout feature during the conversion. Reviewed-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user