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

gpio: altera-a10sr: 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-7-1d5cceeebf8b@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

+7 -7
+7 -7
drivers/gpio/gpio-altera-a10sr.c
··· 35 35 return !!(val & BIT(offset - ALTR_A10SR_LED_VALID_SHIFT)); 36 36 } 37 37 38 - static void altr_a10sr_gpio_set(struct gpio_chip *chip, unsigned int offset, 39 - int value) 38 + static int altr_a10sr_gpio_set(struct gpio_chip *chip, unsigned int offset, 39 + int value) 40 40 { 41 41 struct altr_a10sr_gpio *gpio = gpiochip_get_data(chip); 42 42 43 - regmap_update_bits(gpio->regmap, ALTR_A10SR_LED_REG, 44 - BIT(ALTR_A10SR_LED_VALID_SHIFT + offset), 45 - value ? BIT(ALTR_A10SR_LED_VALID_SHIFT + offset) 46 - : 0); 43 + return regmap_update_bits(gpio->regmap, ALTR_A10SR_LED_REG, 44 + BIT(ALTR_A10SR_LED_VALID_SHIFT + offset), 45 + value ? 46 + BIT(ALTR_A10SR_LED_VALID_SHIFT + offset) : 0); 47 47 } 48 48 49 49 static int altr_a10sr_gpio_direction_input(struct gpio_chip *gc, ··· 69 69 .label = "altr_a10sr_gpio", 70 70 .owner = THIS_MODULE, 71 71 .get = altr_a10sr_gpio_get, 72 - .set = altr_a10sr_gpio_set, 72 + .set_rv = altr_a10sr_gpio_set, 73 73 .direction_input = altr_a10sr_gpio_direction_input, 74 74 .direction_output = altr_a10sr_gpio_direction_output, 75 75 .can_sleep = true,