pinctrl: st: Return pinctrl_gpio_direction_output to transfer the error
authorChen Ni <nichen@iscas.ac.cn>
Wed, 3 Jan 2024 08:50:58 +0000 (08:50 +0000)
committerLinus Walleij <linus.walleij@linaro.org>
Sat, 27 Jan 2024 22:45:22 +0000 (23:45 +0100)
Return pinctrl_gpio_direction_output() in order to transfer the error
if it fails.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20240103085058.3771653-1-nichen@iscas.ac.cn
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-st.c

index 1485573b523c2fbe5090b75fe6d05d23d0dd97c5..5d9abd6547d06f0eb38b940bb8991e2d3b4f9c18 100644 (file)
@@ -723,9 +723,8 @@ static int st_gpio_direction_output(struct gpio_chip *chip,
        struct st_gpio_bank *bank = gpiochip_get_data(chip);
 
        __st_gpio_set(bank, offset, value);
-       pinctrl_gpio_direction_output(chip, offset);
 
-       return 0;
+       return pinctrl_gpio_direction_output(chip, offset);
 }
 
 static int st_gpio_get_direction(struct gpio_chip *chip, unsigned offset)