pinctrl: microchip-sgpio: 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/20250424-gpiochip-set-rv-pinctrl-part2-v1-7-504f91120b99@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
committed by
Linus Walleij
parent
eac1183a17
commit
f0401cce03
@@ -555,10 +555,10 @@ static int microchip_sgpio_get_direction(struct gpio_chip *gc, unsigned int gpio
|
||||
return bank->is_input ? GPIO_LINE_DIRECTION_IN : GPIO_LINE_DIRECTION_OUT;
|
||||
}
|
||||
|
||||
static void microchip_sgpio_set_value(struct gpio_chip *gc,
|
||||
unsigned int gpio, int value)
|
||||
static int microchip_sgpio_set_value(struct gpio_chip *gc, unsigned int gpio,
|
||||
int value)
|
||||
{
|
||||
microchip_sgpio_direction_output(gc, gpio, value);
|
||||
return microchip_sgpio_direction_output(gc, gpio, value);
|
||||
}
|
||||
|
||||
static int microchip_sgpio_get_value(struct gpio_chip *gc, unsigned int gpio)
|
||||
@@ -858,7 +858,7 @@ static int microchip_sgpio_register_bank(struct device *dev,
|
||||
gc->direction_input = microchip_sgpio_direction_input;
|
||||
gc->direction_output = microchip_sgpio_direction_output;
|
||||
gc->get = microchip_sgpio_get_value;
|
||||
gc->set = microchip_sgpio_set_value;
|
||||
gc->set_rv = microchip_sgpio_set_value;
|
||||
gc->request = gpiochip_generic_request;
|
||||
gc->free = gpiochip_generic_free;
|
||||
gc->of_xlate = microchip_sgpio_of_xlate;
|
||||
|
||||
Reference in New Issue
Block a user