diff options
author | Guenter Roeck <linux@roeck-us.net> | 2016-02-28 21:12:17 (GMT) |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2016-03-16 20:11:16 (GMT) |
commit | d0684c8a9354953efdea214b437445c00743cf49 (patch) | |
tree | 0442757196b7ee3e169846a4ef1fa13249870566 /drivers/watchdog/watchdog_dev.c | |
parent | ee142889e32f564f9b5e57b68b06693ec5473074 (diff) | |
download | linux-d0684c8a9354953efdea214b437445c00743cf49.tar.xz |
watchdog: Make stop function optional
Not all hardware watchdogs can be stopped. The driver for
such watchdogs would typically only set the WATCHDOG_HW_RUNNING
flag in its stop function. Make the stop function optional and set
WATCHDOG_HW_RUNNING in the watchdog core if it is not provided.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/watchdog_dev.c')
-rw-r--r-- | drivers/watchdog/watchdog_dev.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c index 5d3a9fa..5163c3e 100644 --- a/drivers/watchdog/watchdog_dev.c +++ b/drivers/watchdog/watchdog_dev.c @@ -246,7 +246,11 @@ static int watchdog_stop(struct watchdog_device *wdd) return -EBUSY; } - err = wdd->ops->stop(wdd); + if (wdd->ops->stop) + err = wdd->ops->stop(wdd); + else + set_bit(WDOG_HW_RUNNING, &wdd->status); + if (err == 0) { clear_bit(WDOG_ACTIVE, &wdd->status); watchdog_update_worker(wdd); |