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

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

+6 -9
+6 -9
drivers/gpio/gpio-bd71815.c
··· 37 37 return (val >> offset) & 1; 38 38 } 39 39 40 - static void bd71815gpo_set(struct gpio_chip *chip, unsigned int offset, 41 - int value) 40 + static int bd71815gpo_set(struct gpio_chip *chip, unsigned int offset, 41 + int value) 42 42 { 43 43 struct bd71815_gpio *bd71815 = gpiochip_get_data(chip); 44 - int ret, bit; 44 + int bit; 45 45 46 46 bit = BIT(offset); 47 47 48 48 if (value) 49 - ret = regmap_set_bits(bd71815->regmap, BD71815_REG_GPO, bit); 50 - else 51 - ret = regmap_clear_bits(bd71815->regmap, BD71815_REG_GPO, bit); 49 + return regmap_set_bits(bd71815->regmap, BD71815_REG_GPO, bit); 52 50 53 - if (ret) 54 - dev_warn(bd71815->dev, "failed to toggle GPO\n"); 51 + return regmap_clear_bits(bd71815->regmap, BD71815_REG_GPO, bit); 55 52 } 56 53 57 54 static int bd71815_gpio_set_config(struct gpio_chip *chip, unsigned int offset, ··· 85 88 .owner = THIS_MODULE, 86 89 .get = bd71815gpo_get, 87 90 .get_direction = bd71815gpo_direction_get, 88 - .set = bd71815gpo_set, 91 + .set_rv = bd71815gpo_set, 89 92 .set_config = bd71815_gpio_set_config, 90 93 .can_sleep = true, 91 94 };