]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
MIPS: rb532: gpio: use new line value setter callbacks
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 7 Apr 2025 07:25:07 +0000 (09:25 +0200)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Sun, 27 Apr 2025 07:21:21 +0000 (09:21 +0200)
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: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/rb532/gpio.c

index ea6ebfea4a672cd0b86723132be9c0f6a5433e15..0e47cd59b6cbdab5c2024c5c9655d0d10a27d489 100644 (file)
@@ -105,13 +105,15 @@ static int rb532_gpio_get(struct gpio_chip *chip, unsigned offset)
 /*
  * Set output GPIO level
  */
-static void rb532_gpio_set(struct gpio_chip *chip,
-                               unsigned offset, int value)
+static int rb532_gpio_set(struct gpio_chip *chip, unsigned int offset,
+                         int value)
 {
        struct rb532_gpio_chip  *gpch;
 
        gpch = gpiochip_get_data(chip);
        rb532_set_bit(value, offset, gpch->regbase + GPIOD);
+
+       return 0;
 }
 
 /*
@@ -162,7 +164,7 @@ static struct rb532_gpio_chip rb532_gpio_chip[] = {
                        .direction_input        = rb532_gpio_direction_input,
                        .direction_output       = rb532_gpio_direction_output,
                        .get                    = rb532_gpio_get,
-                       .set                    = rb532_gpio_set,
+                       .set_rv                 = rb532_gpio_set,
                        .to_irq                 = rb532_gpio_to_irq,
                        .base                   = 0,
                        .ngpio                  = 32,