summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-11-10 10:11:12 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-10 10:11:12 -0800
commit42d4ebb42a17754d2e8344dc1aa486119671d0eb (patch)
treeb5a9e0a4ecc5a9041912102790bb089601c7afa4 /include
parent6aabef681df96b851b4a11459520d4a20ab1cae4 (diff)
parent760d280084f8805e5de73e3591912d5db9da9dbe (diff)
Merge git://www.linux-watchdog.org/linux-watchdog
Pull watchdog update from Wim Van Sebroeck: - New driver for Broadcom 7038 Set-Top Box - imx2_wdt: Use register definition in regmap_write() - intel-mid: add Magic Closure flag - watchdog framework improvements: - Use device tree alias for naming watchdogs - propagate ping error code to the user space - Always evaluate new timeout against min_timeout - Use single variable name for struct watchdog_device - include clean-ups * git://www.linux-watchdog.org/linux-watchdog: watchdog: include: add units for timeout values in kerneldoc watchdog: include: fix some typos watchdog: core: propagate ping error code to the user space watchdog: watchdog_dev: Use single variable name for struct watchdog_device watchdog: Always evaluate new timeout against min_timeout watchdog: intel-mid: add Magic Closure flag watchdog: imx2_wdt: Use register definition in regmap_write() watchdog: watchdog_dev: Use device tree alias for naming watchdogs watchdog: Watchdog driver for Broadcom Set-Top Box watchdog: bcm7038: add device tree binding documentation
Diffstat (limited to 'include')
-rw-r--r--include/linux/watchdog.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
index d74a0e907b9e..027b1f43f12d 100644
--- a/include/linux/watchdog.h
+++ b/include/linux/watchdog.h
@@ -24,8 +24,8 @@ struct watchdog_device;
* @stop: The routine for stopping the watchdog device.
* @ping: The routine that sends a keepalive ping to the watchdog device.
* @status: The routine that shows the status of the watchdog device.
- * @set_timeout:The routine for setting the watchdog devices timeout value.
- * @get_timeleft:The routine that get's the time that's left before a reset.
+ * @set_timeout:The routine for setting the watchdog devices timeout value (in seconds).
+ * @get_timeleft:The routine that gets the time left before a reset (in seconds).
* @ref: The ref operation for dyn. allocated watchdog_device structs
* @unref: The unref operation for dyn. allocated watchdog_device structs
* @ioctl: The routines that handles extra ioctl calls.
@@ -33,7 +33,7 @@ struct watchdog_device;
* The watchdog_ops structure contains a list of low-level operations
* that control a watchdog device. It also contains the module that owns
* these operations. The start and stop function are mandatory, all other
- * functions are optonal.
+ * functions are optional.
*/
struct watchdog_ops {
struct module *owner;
@@ -59,9 +59,9 @@ struct watchdog_ops {
* @info: Pointer to a watchdog_info structure.
* @ops: Pointer to the list of watchdog operations.
* @bootstatus: Status of the watchdog device at boot.
- * @timeout: The watchdog devices timeout value.
- * @min_timeout:The watchdog devices minimum timeout value.
- * @max_timeout:The watchdog devices maximum timeout value.
+ * @timeout: The watchdog devices timeout value (in seconds).
+ * @min_timeout:The watchdog devices minimum timeout value (in seconds).
+ * @max_timeout:The watchdog devices maximum timeout value (in seconds).
* @driver-data:Pointer to the drivers private data.
* @lock: Lock for watchdog core internal use only.
* @status: Field that contains the devices internal status bits.
@@ -119,8 +119,15 @@ static inline void watchdog_set_nowayout(struct watchdog_device *wdd, bool noway
/* Use the following function to check if a timeout value is invalid */
static inline bool watchdog_timeout_invalid(struct watchdog_device *wdd, unsigned int t)
{
- return ((wdd->max_timeout != 0) &&
- (t < wdd->min_timeout || t > wdd->max_timeout));
+ /*
+ * The timeout is invalid if
+ * - the requested value is smaller than the configured minimum timeout,
+ * or
+ * - a maximum timeout is configured, and the requested value is larger
+ * than the maximum timeout.
+ */
+ return t < wdd->min_timeout ||
+ (wdd->max_timeout && t > wdd->max_timeout);
}
/* Use the following functions to manipulate watchdog driver specific data */