Skip to content

Commit d1d3205

Browse files
Bartosz Golaszewskilag-linaro
authored andcommitted
leds: tca6507: 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> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250423-gpiochip-set-rv-leds-v1-4-2f42d8fbb525@linaro.org Signed-off-by: Lee Jones <lee@kernel.org>
1 parent e1cc2c8 commit d1d3205

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/leds/leds-tca6507.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,8 @@ static int tca6507_blink_set(struct led_classdev *led_cdev,
588588
}
589589

590590
#ifdef CONFIG_GPIOLIB
591-
static void tca6507_gpio_set_value(struct gpio_chip *gc,
592-
unsigned offset, int val)
591+
static int tca6507_gpio_set_value(struct gpio_chip *gc, unsigned int offset,
592+
int val)
593593
{
594594
struct tca6507_chip *tca = gpiochip_get_data(gc);
595595
unsigned long flags;
@@ -604,13 +604,14 @@ static void tca6507_gpio_set_value(struct gpio_chip *gc,
604604
spin_unlock_irqrestore(&tca->lock, flags);
605605
if (tca->reg_set)
606606
schedule_work(&tca->work);
607+
608+
return 0;
607609
}
608610

609611
static int tca6507_gpio_direction_output(struct gpio_chip *gc,
610612
unsigned offset, int val)
611613
{
612-
tca6507_gpio_set_value(gc, offset, val);
613-
return 0;
614+
return tca6507_gpio_set_value(gc, offset, val);
614615
}
615616

616617
static int tca6507_probe_gpios(struct device *dev,
@@ -636,7 +637,7 @@ static int tca6507_probe_gpios(struct device *dev,
636637
tca->gpio.base = -1;
637638
tca->gpio.owner = THIS_MODULE;
638639
tca->gpio.direction_output = tca6507_gpio_direction_output;
639-
tca->gpio.set = tca6507_gpio_set_value;
640+
tca->gpio.set_rv = tca6507_gpio_set_value;
640641
tca->gpio.parent = dev;
641642
err = devm_gpiochip_add_data(dev, &tca->gpio, tca);
642643
if (err) {

0 commit comments

Comments
 (0)