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

gpio: bd71828: 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-4-03798bb833eb@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

+6 -9
+6 -9
drivers/gpio/gpio-bd71828.c
··· 16 16 struct gpio_chip gpio; 17 17 }; 18 18 19 - static void bd71828_gpio_set(struct gpio_chip *chip, unsigned int offset, 20 - int value) 19 + static int bd71828_gpio_set(struct gpio_chip *chip, unsigned int offset, 20 + int value) 21 21 { 22 - int ret; 23 22 struct bd71828_gpio *bdgpio = gpiochip_get_data(chip); 24 23 u8 val = (value) ? BD71828_GPIO_OUT_HI : BD71828_GPIO_OUT_LO; 25 24 ··· 27 28 * we are dealing with - then we are done 28 29 */ 29 30 if (offset == HALL_GPIO_OFFSET) 30 - return; 31 + return 0; 31 32 32 - ret = regmap_update_bits(bdgpio->regmap, GPIO_OUT_REG(offset), 33 - BD71828_GPIO_OUT_MASK, val); 34 - if (ret) 35 - dev_err(bdgpio->dev, "Could not set gpio to %d\n", value); 33 + return regmap_update_bits(bdgpio->regmap, GPIO_OUT_REG(offset), 34 + BD71828_GPIO_OUT_MASK, val); 36 35 } 37 36 38 37 static int bd71828_gpio_get(struct gpio_chip *chip, unsigned int offset) ··· 109 112 bdgpio->gpio.set_config = bd71828_gpio_set_config; 110 113 bdgpio->gpio.can_sleep = true; 111 114 bdgpio->gpio.get = bd71828_gpio_get; 112 - bdgpio->gpio.set = bd71828_gpio_set; 115 + bdgpio->gpio.set_rv = bd71828_gpio_set; 113 116 bdgpio->gpio.base = -1; 114 117 115 118 /*