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

gpio: adp5585: use new 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.

Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Link: https://lore.kernel.org/r/20250303-gpiochip-set-conversion-v1-6-1d5cceeebf8b@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

+6 -4
+6 -4
drivers/gpio/gpio-adp5585.c
··· 86 86 return !!(val & bit); 87 87 } 88 88 89 - static void adp5585_gpio_set_value(struct gpio_chip *chip, unsigned int off, int val) 89 + static int adp5585_gpio_set_value(struct gpio_chip *chip, unsigned int off, 90 + int val) 90 91 { 91 92 struct adp5585_gpio_dev *adp5585_gpio = gpiochip_get_data(chip); 92 93 unsigned int bank = ADP5585_BANK(off); 93 94 unsigned int bit = ADP5585_BIT(off); 94 95 95 - regmap_update_bits(adp5585_gpio->regmap, ADP5585_GPO_DATA_OUT_A + bank, 96 - bit, val ? bit : 0); 96 + return regmap_update_bits(adp5585_gpio->regmap, 97 + ADP5585_GPO_DATA_OUT_A + bank, 98 + bit, val ? bit : 0); 97 99 } 98 100 99 101 static int adp5585_gpio_set_bias(struct adp5585_gpio_dev *adp5585_gpio, ··· 194 192 gc->direction_input = adp5585_gpio_direction_input; 195 193 gc->direction_output = adp5585_gpio_direction_output; 196 194 gc->get = adp5585_gpio_get_value; 197 - gc->set = adp5585_gpio_set_value; 195 + gc->set_rv = adp5585_gpio_set_value; 198 196 gc->set_config = adp5585_gpio_set_config; 199 197 gc->can_sleep = true; 200 198