]> git.ipfire.org Git - thirdparty/linux.git/commit
watchdog: Always return time left until watchdog times out
authorGuenter Roeck <linux@roeck-us.net>
Tue, 18 Nov 2025 21:04:07 +0000 (13:04 -0800)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Sun, 18 Jan 2026 09:55:08 +0000 (10:55 +0100)
commitb0fd1f580bd1eaea1074408dd8ebbc6d3a1ba03c
treeeb533a63bb6cfa4cd083ec72e13c22427d14cf86
parent0bf75b9c8a0eb1ef46ce85a393dd27ae801fc207
watchdog: Always return time left until watchdog times out

The watchdog core knows when the most recent keepalive was sent. It also
knows the configured timeout. With that, it can always calculate and
return the time left until a watchdog times out, even if its driver does
not support it.

Convert watchdog_get_timeleft() into a void function. It never returns an
error after this patch is applied, so the error checks in the calling code
are now pointless and can be removed.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/watchdog_dev.c