pinctrl: stm32: return errors from stm32_gpio_direction_output()
authorSergey Shtylyov <s.shtylyov@omp.ru>
Wed, 15 Nov 2023 20:34:53 +0000 (23:34 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 24 Nov 2023 10:22:11 +0000 (11:22 +0100)
In the STMicroelectronics STM32 driver, stm32_gpio_direction_output()
ignores the result of pinctrl_gpio_direction_output() for no good reason.
Let's propagate errors from pinctrl_gpio_direction_output() upstream...

Found by Linux Verification Center (linuxtesting.org) with the Svace static
analysis tool.

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/5ce023a8-db0c-13a9-be42-09e3348ca44d@omp.ru
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/stm32/pinctrl-stm32.c

index 64e8201c7eacd347ffa85c5139b937e0725016ec..2f2b777fcf4fa913ed89a603c6ca4b6d12562add 100644 (file)
@@ -240,9 +240,8 @@ static int stm32_gpio_direction_output(struct gpio_chip *chip,
        struct stm32_gpio_bank *bank = gpiochip_get_data(chip);
 
        __stm32_gpio_set(bank, offset, value);
-       pinctrl_gpio_direction_output(chip, offset);
 
-       return 0;
+       return pinctrl_gpio_direction_output(chip, offset);
 }