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: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
This commit is contained in:
parent
2ca689da91
commit
bad9665198
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue