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

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

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

+4 -2
+4 -2
drivers/gpio/gpio-pch.c
··· 99 99 spinlock_t spinlock; 100 100 }; 101 101 102 - static void pch_gpio_set(struct gpio_chip *gpio, unsigned int nr, int val) 102 + static int pch_gpio_set(struct gpio_chip *gpio, unsigned int nr, int val) 103 103 { 104 104 u32 reg_val; 105 105 struct pch_gpio *chip = gpiochip_get_data(gpio); ··· 114 114 115 115 iowrite32(reg_val, &chip->reg->po); 116 116 spin_unlock_irqrestore(&chip->spinlock, flags); 117 + 118 + return 0; 117 119 } 118 120 119 121 static int pch_gpio_get(struct gpio_chip *gpio, unsigned int nr) ··· 219 217 gpio->direction_input = pch_gpio_direction_input; 220 218 gpio->get = pch_gpio_get; 221 219 gpio->direction_output = pch_gpio_direction_output; 222 - gpio->set = pch_gpio_set; 220 + gpio->set_rv = pch_gpio_set; 223 221 gpio->base = -1; 224 222 gpio->ngpio = gpio_pins[chip->ioh]; 225 223 gpio->can_sleep = false;