pinctrl: st: 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> Link: https://lore.kernel.org/20250612-gpiochip-set-rv-pinctrl-remaining-v1-2-556b0a530cd4@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
committed by
Linus Walleij
parent
1ae8c585f7
commit
fd81c42a83
@@ -711,10 +711,12 @@ static int st_gpio_get(struct gpio_chip *chip, unsigned offset)
|
||||
return !!(readl(bank->base + REG_PIO_PIN) & BIT(offset));
|
||||
}
|
||||
|
||||
static void st_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
|
||||
static int st_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
|
||||
{
|
||||
struct st_gpio_bank *bank = gpiochip_get_data(chip);
|
||||
__st_gpio_set(bank, offset, value);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int st_gpio_direction_output(struct gpio_chip *chip,
|
||||
@@ -1470,7 +1472,7 @@ static const struct gpio_chip st_gpio_template = {
|
||||
.request = gpiochip_generic_request,
|
||||
.free = gpiochip_generic_free,
|
||||
.get = st_gpio_get,
|
||||
.set = st_gpio_set,
|
||||
.set_rv = st_gpio_set,
|
||||
.direction_input = pinctrl_gpio_direction_input,
|
||||
.direction_output = st_gpio_direction_output,
|
||||
.get_direction = st_gpio_get_direction,
|
||||
|
||||
Reference in New Issue
Block a user