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:
parent
dc41aad2a5
commit
b0d46a3175
1 changed files with 2 additions and 2 deletions
|
@ -106,8 +106,8 @@ static int iwdg_stm32_install_timeout(struct device *dev,
|
||||||
|
|
||||||
iwdg_stm32_convert_timeout(timeout, &prescaler, &reload);
|
iwdg_stm32_convert_timeout(timeout, &prescaler, &reload);
|
||||||
|
|
||||||
if (IS_IWDG_TIMEOUT(timeout) || IS_IWDG_PRESCALER(prescaler) ||
|
if (!(IS_IWDG_TIMEOUT(timeout) && IS_IWDG_PRESCALER(prescaler) &&
|
||||||
IS_IWDG_RELOAD(reload)) {
|
IS_IWDG_RELOAD(reload))) {
|
||||||
/* One of the parameters provided is invalid */
|
/* One of the parameters provided is invalid */
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue