diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2019-11-12 10:19:50 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-11-13 15:20:25 +0100 |
commit | 309ce31b811c515207a86de28da37d7a481b7212 (patch) | |
tree | 8f5dd7b3b86feb068bbca3266067502a529bc5de /drivers/watchdog/stm32_iwdg.c | |
parent | 218427e91205a94026587421958df719cc96b2ee (diff) | |
download | barebox-309ce31b811c515207a86de28da37d7a481b7212.tar.gz barebox-309ce31b811c515207a86de28da37d7a481b7212.tar.xz |
watchdog: stm32_iwdg: return -ENOSYS on attempt to disable
The stm32_iwdg watchdog can't be disabled. To have the wd commant report
this fact correctly to the user, the ->set_timeout needs to return -ENOSYS
which is interpreted as "Watchdog cannot be disabled" instead of -EINVAL
which means "Timeout value out of range".
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/watchdog/stm32_iwdg.c')
-rw-r--r-- | drivers/watchdog/stm32_iwdg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/watchdog/stm32_iwdg.c b/drivers/watchdog/stm32_iwdg.c index 4d252e558c..808d7c8372 100644 --- a/drivers/watchdog/stm32_iwdg.c +++ b/drivers/watchdog/stm32_iwdg.c @@ -132,7 +132,7 @@ static int stm32_iwdg_set_timeout(struct watchdog *wdd, unsigned int timeout) int ret; if (!timeout) - return -EINVAL; /* can't disable */ + return -ENOSYS; /* can't disable */ if (timeout > wdd->timeout_max) return -EINVAL; |