Commit 22bbdc2f authored by Sergio Rodriguez's avatar Sergio Rodriguez Committed by Anas Nashif
Browse files

soc: stm32f1: gpio: Fix unnecessary else statement


The bitfield determining the I/O direction already defines the pin
as either input or output, cannot be none or both at the same time

This issue was reported by Coverity

Coverity-CID: 151970

Change-Id: I18d5387139d6834004ba3269c5b54176bdc97ea7
Signed-off-by: default avatarSergio Rodriguez <sergio.sf.rodriguez@intel.com>
parent 3b626c5e
Showing with 3 additions and 3 deletions
+3 -3
......@@ -87,8 +87,10 @@ int stm32_gpio_flags_to_conf(int flags, int *pincfg)
}
if (direction == GPIO_DIR_OUT) {
/* Pin is configured as an output */
*pincfg = STM32F10X_PIN_CONFIG_DRIVE_PUSH_PULL;
} else if (direction == GPIO_DIR_IN) {
} else {
/* Pin is configured as an input */
int pud = flags & GPIO_PUD_MASK;
/* pull-{up,down} maybe? */
......@@ -100,8 +102,6 @@ int stm32_gpio_flags_to_conf(int flags, int *pincfg)
/* floating */
*pincfg = STM32F10X_PIN_CONFIG_BIAS_HIGH_IMPEDANCE;
}
} else {
return -ENOTSUP;
}
return 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment