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

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

Link: https://lore.kernel.org/r/20250619-gpiochip-set-rv-gpio-v2-1-74abf689fbd8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

+3 -2
+3 -2
drivers/gpio/gpio-pca9570.c
··· 88 88 return !!(buffer & BIT(offset)); 89 89 } 90 90 91 - static void pca9570_set(struct gpio_chip *chip, unsigned offset, int value) 91 + static int pca9570_set(struct gpio_chip *chip, unsigned int offset, int value) 92 92 { 93 93 struct pca9570 *gpio = gpiochip_get_data(chip); 94 94 u8 buffer; ··· 110 110 111 111 out: 112 112 mutex_unlock(&gpio->lock); 113 + return ret; 113 114 } 114 115 115 116 static int pca9570_probe(struct i2c_client *client) ··· 126 125 gpio->chip.owner = THIS_MODULE; 127 126 gpio->chip.get_direction = pca9570_get_direction; 128 127 gpio->chip.get = pca9570_get; 129 - gpio->chip.set = pca9570_set; 128 + gpio->chip.set_rv = pca9570_set; 130 129 gpio->chip.base = -1; 131 130 gpio->chip_data = device_get_match_data(&client->dev); 132 131 gpio->chip.ngpio = gpio->chip_data->ngpio;