Skip to content

Commit 43c8981

Browse files
Bartosz GolaszewskiLinus Walleij
authored andcommitted
pinctrl: stm32: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Antonio Borneo <antonio.borneo@foss.st.com> Link: https://lore.kernel.org/20250424-gpiochip-set-rv-pinctrl-part2-v1-5-504f91120b99@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 059f547 commit 43c8981

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/pinctrl/stm32/pinctrl-stm32.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,14 @@ static int stm32_gpio_get(struct gpio_chip *chip, unsigned offset)
228228
return !!(readl_relaxed(bank->base + STM32_GPIO_IDR) & BIT(offset));
229229
}
230230

231-
static void stm32_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
231+
static int stm32_gpio_set(struct gpio_chip *chip, unsigned int offset,
232+
int value)
232233
{
233234
struct stm32_gpio_bank *bank = gpiochip_get_data(chip);
234235

235236
__stm32_gpio_set(bank, offset, value);
237+
238+
return 0;
236239
}
237240

238241
static int stm32_gpio_direction_output(struct gpio_chip *chip,
@@ -308,7 +311,7 @@ static const struct gpio_chip stm32_gpio_template = {
308311
.request = stm32_gpio_request,
309312
.free = pinctrl_gpio_free,
310313
.get = stm32_gpio_get,
311-
.set = stm32_gpio_set,
314+
.set_rv = stm32_gpio_set,
312315
.direction_input = pinctrl_gpio_direction_input,
313316
.direction_output = stm32_gpio_direction_output,
314317
.to_irq = stm32_gpio_to_irq,

0 commit comments

Comments
 (0)