Skip to content

Commit f0401cc

Browse files
Bartosz GolaszewskiLinus Walleij
authored andcommitted
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>
1 parent eac1183 commit f0401cc

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/pinctrl/pinctrl-microchip-sgpio.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -555,10 +555,10 @@ static int microchip_sgpio_get_direction(struct gpio_chip *gc, unsigned int gpio
555555
return bank->is_input ? GPIO_LINE_DIRECTION_IN : GPIO_LINE_DIRECTION_OUT;
556556
}
557557

558-
static void microchip_sgpio_set_value(struct gpio_chip *gc,
559-
unsigned int gpio, int value)
558+
static int microchip_sgpio_set_value(struct gpio_chip *gc, unsigned int gpio,
559+
int value)
560560
{
561-
microchip_sgpio_direction_output(gc, gpio, value);
561+
return microchip_sgpio_direction_output(gc, gpio, value);
562562
}
563563

564564
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,
858858
gc->direction_input = microchip_sgpio_direction_input;
859859
gc->direction_output = microchip_sgpio_direction_output;
860860
gc->get = microchip_sgpio_get_value;
861-
gc->set = microchip_sgpio_set_value;
861+
gc->set_rv = microchip_sgpio_set_value;
862862
gc->request = gpiochip_generic_request;
863863
gc->free = gpiochip_generic_free;
864864
gc->of_xlate = microchip_sgpio_of_xlate;

0 commit comments

Comments
 (0)