watchdog: stm32: fix logic error

While installing timeout, the logic to judge if
timeout parameter is valid is wrong.

Signed-off-by: Jun Li <jun.r.li@intel.com>
This commit is contained in:
Jun Li 2019-03-11 16:11:33 -07:00 committed by Kumar Gala
commit b0d46a3175

View file

@ -106,8 +106,8 @@ static int iwdg_stm32_install_timeout(struct device *dev,
iwdg_stm32_convert_timeout(timeout, &prescaler, &reload);
if (IS_IWDG_TIMEOUT(timeout) || IS_IWDG_PRESCALER(prescaler) ||
IS_IWDG_RELOAD(reload)) {
if (!(IS_IWDG_TIMEOUT(timeout) && IS_IWDG_PRESCALER(prescaler) &&
IS_IWDG_RELOAD(reload))) {
/* One of the parameters provided is invalid */
return -EINVAL;
}