From a1aabbb08adec071fcfe8fa7104eb65b7ee59f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phil=C3=A9mon=20Jaermann?= Date: Sun, 11 Aug 2019 20:19:12 +0200 Subject: [PATCH] drivers: watchdog: Pass timeout in ms if iwdg is started at boot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit iwdg_stm32_install_timeout expects a timeout passed in milli seconds. As the timeout is defined in micro seconds in Kconfig.stm32, we need to divide by USEC_PER_MSEC when CONFIG_IWDG_START_AT_BOOT is activated because iwdg_stm32_install_timeout makes the multiplication by USEC_PER_MSEC. Fixes #18695 Signed-off-by: Philémon Jaermann --- drivers/watchdog/wdt_iwdg_stm32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog/wdt_iwdg_stm32.c b/drivers/watchdog/wdt_iwdg_stm32.c index b0cff3b2bb0..cb52cc49b7f 100644 --- a/drivers/watchdog/wdt_iwdg_stm32.c +++ b/drivers/watchdog/wdt_iwdg_stm32.c @@ -151,7 +151,7 @@ static int iwdg_stm32_init(struct device *dev) #ifdef CONFIG_IWDG_STM32_START_AT_BOOT IWDG_TypeDef *iwdg = IWDG_STM32_STRUCT(dev); struct wdt_timeout_cfg config = { - .window.max = CONFIG_IWDG_STM32_TIMEOUT * USEC_PER_MSEC, + .window.max = CONFIG_IWDG_STM32_TIMEOUT / USEC_PER_MSEC, }; LL_IWDG_Enable(iwdg);