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

gpio: 74x164: 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.

Link: https://lore.kernel.org/r/20250303-gpiochip-set-conversion-v1-1-1d5cceeebf8b@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

+8 -8
+8 -8
drivers/gpio/gpio-74x164.c
··· 50 50 return !!(chip->buffer[bank] & BIT(pin)); 51 51 } 52 52 53 - static void gen_74x164_set_value(struct gpio_chip *gc, 54 - unsigned offset, int val) 53 + static int gen_74x164_set_value(struct gpio_chip *gc, 54 + unsigned int offset, int val) 55 55 { 56 56 struct gen_74x164_chip *chip = gpiochip_get_data(gc); 57 57 u8 bank = chip->registers - 1 - offset / 8; ··· 64 64 else 65 65 chip->buffer[bank] &= ~BIT(pin); 66 66 67 - __gen_74x164_write_config(chip); 67 + return __gen_74x164_write_config(chip); 68 68 } 69 69 70 - static void gen_74x164_set_multiple(struct gpio_chip *gc, unsigned long *mask, 71 - unsigned long *bits) 70 + static int gen_74x164_set_multiple(struct gpio_chip *gc, unsigned long *mask, 71 + unsigned long *bits) 72 72 { 73 73 struct gen_74x164_chip *chip = gpiochip_get_data(gc); 74 74 unsigned long offset; ··· 85 85 chip->buffer[bank] &= ~bankmask; 86 86 chip->buffer[bank] |= bitmask; 87 87 } 88 - __gen_74x164_write_config(chip); 88 + return __gen_74x164_write_config(chip); 89 89 } 90 90 91 91 static int gen_74x164_direction_output(struct gpio_chip *gc, ··· 141 141 chip->gpio_chip.label = spi->modalias; 142 142 chip->gpio_chip.direction_output = gen_74x164_direction_output; 143 143 chip->gpio_chip.get = gen_74x164_get_value; 144 - chip->gpio_chip.set = gen_74x164_set_value; 145 - chip->gpio_chip.set_multiple = gen_74x164_set_multiple; 144 + chip->gpio_chip.set_rv = gen_74x164_set_value; 145 + chip->gpio_chip.set_multiple_rv = gen_74x164_set_multiple; 146 146 chip->gpio_chip.base = -1; 147 147 chip->gpio_chip.ngpio = GEN_74X164_NUMBER_GPIOS * chip->registers; 148 148 chip->gpio_chip.can_sleep = true;