summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-04-26 13:34:07 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-05-03 12:38:19 +0200
commit17bedd93623f27e773775b7164d27b7e9edfdf4b (patch)
treec48f569689cbff4ffd26b842de364ee21986a996
parentaf0f068a6edad45b033e772056ac0352e1ba3613 (diff)
downloadbarebox-17bedd93623f27e773775b7164d27b7e9edfdf4b.tar.gz
barebox-17bedd93623f27e773775b7164d27b7e9edfdf4b.tar.xz
sandbox: watchdog: don't return positive values from set_timeout
linux_watchdog_set_timeout() does return alarm(), which can never fail and returns either zero or a positive value. watchdog::set_timeout on the other hand should return either 0 or a negative number on error. Ignore linux_watchdog_set_timeout()'s return value, so watchdog_set_timeout propagates the correct value. This fixes an issue where seconds_to_expire wasn't updated on subsequent pings of this watchdog. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210426113408.24903-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/sandbox/board/watchdog.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/sandbox/board/watchdog.c b/arch/sandbox/board/watchdog.c
index 336451282..e1cff7a0b 100644
--- a/arch/sandbox/board/watchdog.c
+++ b/arch/sandbox/board/watchdog.c
@@ -29,7 +29,8 @@ static int sandbox_watchdog_set_timeout(struct watchdog *wdd, unsigned int timeo
if (timeout > wdd->timeout_max)
return -EINVAL;
- return linux_watchdog_set_timeout(timeout);
+ linux_watchdog_set_timeout(timeout);
+ return 0;
}
static int sandbox_watchdog_probe(struct device_d *dev)