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

gpio: bd9571mwv: 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: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/20250310-gpiochip-set-conversion-v1-5-03798bb833eb@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

+4 -4
+4 -4
drivers/gpio/gpio-bd9571mwv.c
··· 72 72 return val & BIT(offset); 73 73 } 74 74 75 - static void bd9571mwv_gpio_set(struct gpio_chip *chip, unsigned int offset, 75 + static int bd9571mwv_gpio_set(struct gpio_chip *chip, unsigned int offset, 76 76 int value) 77 77 { 78 78 struct bd9571mwv_gpio *gpio = gpiochip_get_data(chip); 79 79 80 - regmap_update_bits(gpio->regmap, BD9571MWV_GPIO_OUT, 81 - BIT(offset), value ? BIT(offset) : 0); 80 + return regmap_update_bits(gpio->regmap, BD9571MWV_GPIO_OUT, 81 + BIT(offset), value ? BIT(offset) : 0); 82 82 } 83 83 84 84 static const struct gpio_chip template_chip = { ··· 88 88 .direction_input = bd9571mwv_gpio_direction_input, 89 89 .direction_output = bd9571mwv_gpio_direction_output, 90 90 .get = bd9571mwv_gpio_get, 91 - .set = bd9571mwv_gpio_set, 91 + .set_rv = bd9571mwv_gpio_set, 92 92 .base = -1, 93 93 .ngpio = 2, 94 94 .can_sleep = true,