Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: mvebu: use value returning setters

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>

+4 -4
+4 -4
drivers/gpio/gpio-mvebu.c
··· 298 298 /* 299 299 * Functions implementing the gpio_chip methods 300 300 */ 301 - static void mvebu_gpio_set(struct gpio_chip *chip, unsigned int pin, int value) 301 + static int mvebu_gpio_set(struct gpio_chip *chip, unsigned int pin, int value) 302 302 { 303 303 struct mvebu_gpio_chip *mvchip = gpiochip_get_data(chip); 304 304 305 - regmap_update_bits(mvchip->regs, GPIO_OUT_OFF + mvchip->offset, 306 - BIT(pin), value ? BIT(pin) : 0); 305 + return regmap_update_bits(mvchip->regs, GPIO_OUT_OFF + mvchip->offset, 306 + BIT(pin), value ? BIT(pin) : 0); 307 307 } 308 308 309 309 static int mvebu_gpio_get(struct gpio_chip *chip, unsigned int pin) ··· 1173 1173 mvchip->chip.direction_input = mvebu_gpio_direction_input; 1174 1174 mvchip->chip.get = mvebu_gpio_get; 1175 1175 mvchip->chip.direction_output = mvebu_gpio_direction_output; 1176 - mvchip->chip.set = mvebu_gpio_set; 1176 + mvchip->chip.set_rv = mvebu_gpio_set; 1177 1177 if (have_irqs) 1178 1178 mvchip->chip.to_irq = mvebu_gpio_to_irq; 1179 1179 mvchip->chip.base = id * MVEBU_MAX_GPIO_PER_BANK;