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

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

Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20250303-gpiochip-set-conversion-v1-11-1d5cceeebf8b@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

+5 -4
+5 -4
drivers/gpio/gpio-arizona.c
··· 121 121 ARIZONA_GPN_DIR | ARIZONA_GPN_LVL, value); 122 122 } 123 123 124 - static void arizona_gpio_set(struct gpio_chip *chip, unsigned offset, int value) 124 + static int arizona_gpio_set(struct gpio_chip *chip, unsigned int offset, 125 + int value) 125 126 { 126 127 struct arizona_gpio *arizona_gpio = gpiochip_get_data(chip); 127 128 struct arizona *arizona = arizona_gpio->arizona; ··· 130 129 if (value) 131 130 value = ARIZONA_GPN_LVL; 132 131 133 - regmap_update_bits(arizona->regmap, ARIZONA_GPIO1_CTRL + offset, 134 - ARIZONA_GPN_LVL, value); 132 + return regmap_update_bits(arizona->regmap, ARIZONA_GPIO1_CTRL + offset, 133 + ARIZONA_GPN_LVL, value); 135 134 } 136 135 137 136 static const struct gpio_chip template_chip = { ··· 140 139 .direction_input = arizona_gpio_direction_in, 141 140 .get = arizona_gpio_get, 142 141 .direction_output = arizona_gpio_direction_out, 143 - .set = arizona_gpio_set, 142 + .set_rv = arizona_gpio_set, 144 143 .can_sleep = true, 145 144 }; 146 145