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

gpio: davinci: 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-14-bc4cfd38dae3@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

+4 -2
+4 -2
drivers/gpio/gpio-davinci.c
··· 139 139 /* 140 140 * Assuming the pin is muxed as a gpio output, set its output value. 141 141 */ 142 - static void 142 + static int 143 143 davinci_gpio_set(struct gpio_chip *chip, unsigned offset, int value) 144 144 { 145 145 struct davinci_gpio_controller *d = gpiochip_get_data(chip); ··· 150 150 151 151 writel_relaxed(__gpio_mask(offset), 152 152 value ? &g->set_data : &g->clr_data); 153 + 154 + return 0; 153 155 } 154 156 155 157 static int davinci_gpio_probe(struct platform_device *pdev) ··· 211 209 chips->chip.direction_input = davinci_direction_in; 212 210 chips->chip.get = davinci_gpio_get; 213 211 chips->chip.direction_output = davinci_direction_out; 214 - chips->chip.set = davinci_gpio_set; 212 + chips->chip.set_rv = davinci_gpio_set; 215 213 216 214 chips->chip.ngpio = ngpio; 217 215 chips->chip.base = -1;