Skip to content

Commit 65a0b13

Browse files
author
Bartosz Golaszewski
committed
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>
1 parent 3fccfa5 commit 65a0b13

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

drivers/gpio/gpio-altera-a10sr.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ static int altr_a10sr_gpio_get(struct gpio_chip *chip, unsigned int offset)
3535
return !!(val & BIT(offset - ALTR_A10SR_LED_VALID_SHIFT));
3636
}
3737

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)
4040
{
4141
struct altr_a10sr_gpio *gpio = gpiochip_get_data(chip);
4242

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);
4747
}
4848

4949
static int altr_a10sr_gpio_direction_input(struct gpio_chip *gc,
@@ -69,7 +69,7 @@ static const struct gpio_chip altr_a10sr_gc = {
6969
.label = "altr_a10sr_gpio",
7070
.owner = THIS_MODULE,
7171
.get = altr_a10sr_gpio_get,
72-
.set = altr_a10sr_gpio_set,
72+
.set_rv = altr_a10sr_gpio_set,
7373
.direction_input = altr_a10sr_gpio_direction_input,
7474
.direction_output = altr_a10sr_gpio_direction_output,
7575
.can_sleep = true,

0 commit comments

Comments
 (0)