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

mfd: ucb1x00: 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.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20250407-gpiochip-set-rv-mfd-v1-3-43f4d86d01d1@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Bartosz Golaszewski and committed by
Lee Jones
cf5c739a 65197421

+5 -2
+5 -2
drivers/mfd/ucb1x00-core.c
··· 104 104 return ucb1x00_reg_read(ucb, UCB_IO_DATA); 105 105 } 106 106 107 - static void ucb1x00_gpio_set(struct gpio_chip *chip, unsigned offset, int value) 107 + static int ucb1x00_gpio_set(struct gpio_chip *chip, unsigned int offset, 108 + int value) 108 109 { 109 110 struct ucb1x00 *ucb = gpiochip_get_data(chip); 110 111 unsigned long flags; ··· 120 119 ucb1x00_reg_write(ucb, UCB_IO_DATA, ucb->io_out); 121 120 ucb1x00_disable(ucb); 122 121 spin_unlock_irqrestore(&ucb->io_lock, flags); 122 + 123 + return 0; 123 124 } 124 125 125 126 static int ucb1x00_gpio_get(struct gpio_chip *chip, unsigned offset) ··· 570 567 ucb->gpio.owner = THIS_MODULE; 571 568 ucb->gpio.base = pdata->gpio_base; 572 569 ucb->gpio.ngpio = 10; 573 - ucb->gpio.set = ucb1x00_gpio_set; 570 + ucb->gpio.set_rv = ucb1x00_gpio_set; 574 571 ucb->gpio.get = ucb1x00_gpio_get; 575 572 ucb->gpio.direction_input = ucb1x00_gpio_direction_input; 576 573 ucb->gpio.direction_output = ucb1x00_gpio_direction_output;