diff --git a/arch/arm/soc/st_stm32/stm32f3/soc_gpio.c b/arch/arm/soc/st_stm32/stm32f3/soc_gpio.c index 5aed6ac2058..adba4c8cef8 100644 --- a/arch/arm/soc/st_stm32/stm32f3/soc_gpio.c +++ b/arch/arm/soc/st_stm32/stm32f3/soc_gpio.c @@ -79,7 +79,7 @@ int stm32_gpio_flags_to_conf(int flags, int *pincfg) STM32F3X_PIN_CONFIG_DRIVE_PUSH_PULL_PD; } } - } else if (direction == GPIO_DIR_IN) { + } else { if (pud == GPIO_PUD_PULL_UP) { *pincfg = STM32F3X_PIN_CONFIG_BIAS_PULL_UP; } else if (pud == GPIO_PUD_PULL_DOWN) { @@ -88,8 +88,6 @@ int stm32_gpio_flags_to_conf(int flags, int *pincfg) /* floating */ *pincfg = STM32F3X_PIN_CONFIG_BIAS_HIGH_IMPEDANCE; } - } else { - return -ENOTSUP; } return 0; diff --git a/arch/arm/soc/st_stm32/stm32f4/soc_gpio.c b/arch/arm/soc/st_stm32/stm32f4/soc_gpio.c index 8a0bd865bef..b4b7d660011 100644 --- a/arch/arm/soc/st_stm32/stm32f4/soc_gpio.c +++ b/arch/arm/soc/st_stm32/stm32f4/soc_gpio.c @@ -144,7 +144,7 @@ int stm32_gpio_flags_to_conf(int flags, int *pincfg) } else { *pincfg = STM32F4X_PIN_CONFIG_DRIVE_PUSH_PULL; } - } else if (direction == GPIO_DIR_IN) { + } else { if (pud == GPIO_PUD_PULL_UP) { *pincfg = STM32F4X_PIN_CONFIG_BIAS_PULL_UP; } else if (pud == GPIO_PUD_PULL_DOWN) { @@ -152,8 +152,6 @@ int stm32_gpio_flags_to_conf(int flags, int *pincfg) } else { *pincfg = STM32F4X_PIN_CONFIG_BIAS_HIGH_IMPEDANCE; } - } else { - return -ENOTSUP; } return 0; diff --git a/arch/arm/soc/st_stm32/stm32l4/soc_gpio.c b/arch/arm/soc/st_stm32/stm32l4/soc_gpio.c index db176f1dc41..bbf17ed0370 100644 --- a/arch/arm/soc/st_stm32/stm32l4/soc_gpio.c +++ b/arch/arm/soc/st_stm32/stm32l4/soc_gpio.c @@ -139,7 +139,7 @@ int stm32_gpio_flags_to_conf(int flags, int *pincfg) if (direction == GPIO_DIR_OUT) { *pincfg = STM32L4X_PIN_CONFIG_PUSH_PULL; - } else if (direction == GPIO_DIR_IN) { + } else { int pud = flags & GPIO_PUD_MASK; /* pull-{up,down} maybe? */ @@ -151,8 +151,6 @@ int stm32_gpio_flags_to_conf(int flags, int *pincfg) /* floating */ *pincfg = STM32L4X_PIN_CONFIG_BIAS_HIGH_IMPEDANCE; } - } else { - return -ENOTSUP; } return 0;