]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpio: mvebu: use value returning setters
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 20 Feb 2025 09:57:12 +0000 (10:57 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 26 Feb 2025 10:17:40 +0000 (11:17 +0100)
struct gpio_chip now has additional variants of the set(_multiple)
driver callbacks that return an integer to indicate success or failure.
Convert the driver to using them.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/20250220-gpio-set-retval-v2-15-bc4cfd38dae3@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-mvebu.c

index 363bad286c329e21ad4573568f89befa9655a9c1..3604abcb6fecb3a12b67803fe26cd19d28414173 100644 (file)
@@ -298,12 +298,12 @@ static unsigned int mvebu_pwmreg_blink_off_duration(struct mvebu_pwm *mvpwm)
 /*
  * Functions implementing the gpio_chip methods
  */
-static void mvebu_gpio_set(struct gpio_chip *chip, unsigned int pin, int value)
+static int mvebu_gpio_set(struct gpio_chip *chip, unsigned int pin, int value)
 {
        struct mvebu_gpio_chip *mvchip = gpiochip_get_data(chip);
 
-       regmap_update_bits(mvchip->regs, GPIO_OUT_OFF + mvchip->offset,
-                          BIT(pin), value ? BIT(pin) : 0);
+       return regmap_update_bits(mvchip->regs, GPIO_OUT_OFF + mvchip->offset,
+                                 BIT(pin), value ? BIT(pin) : 0);
 }
 
 static int mvebu_gpio_get(struct gpio_chip *chip, unsigned int pin)
@@ -1173,7 +1173,7 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
        mvchip->chip.direction_input = mvebu_gpio_direction_input;
        mvchip->chip.get = mvebu_gpio_get;
        mvchip->chip.direction_output = mvebu_gpio_direction_output;
-       mvchip->chip.set = mvebu_gpio_set;
+       mvchip->chip.set_rv = mvebu_gpio_set;
        if (have_irqs)
                mvchip->chip.to_irq = mvebu_gpio_to_irq;
        mvchip->chip.base = id * MVEBU_MAX_GPIO_PER_BANK;