drivers: watchdog: Pass timeout in ms if iwdg is started at boot

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 <p.jaermann@gmail.com>
This commit is contained in:
Philémon Jaermann 2019-08-11 20:19:12 +02:00 committed by Kumar Gala
commit a1aabbb08a

View file

@ -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);