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:
Sergio Rodriguez 2016-11-17 16:06:00 -08:00 committed by Anas Nashif
commit bad9665198

View file

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