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

gpio: pl061: 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.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250619-gpiochip-set-rv-gpio-v2-4-74abf689fbd8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

+4 -2
+4 -2
drivers/gpio/gpio-pl061.c
··· 115 115 return !!readb(pl061->base + (BIT(offset + 2))); 116 116 } 117 117 118 - static void pl061_set_value(struct gpio_chip *gc, unsigned offset, int value) 118 + static int pl061_set_value(struct gpio_chip *gc, unsigned int offset, int value) 119 119 { 120 120 struct pl061 *pl061 = gpiochip_get_data(gc); 121 121 122 122 writeb(!!value << offset, pl061->base + (BIT(offset + 2))); 123 + 124 + return 0; 123 125 } 124 126 125 127 static int pl061_irq_type(struct irq_data *d, unsigned trigger) ··· 330 328 pl061->gc.direction_input = pl061_direction_input; 331 329 pl061->gc.direction_output = pl061_direction_output; 332 330 pl061->gc.get = pl061_get_value; 333 - pl061->gc.set = pl061_set_value; 331 + pl061->gc.set_rv = pl061_set_value; 334 332 pl061->gc.ngpio = PL061_GPIO_NR; 335 333 pl061->gc.label = dev_name(dev); 336 334 pl061->gc.parent = dev;