Skip to content

Commit 2aafd2e

Browse files
Bartosz Golaszewskilag-linaro
authored andcommitted
leds: pca955x: 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-2-2f42d8fbb525@linaro.org Signed-off-by: Lee Jones <lee@kernel.org>
1 parent ee08ec5 commit 2aafd2e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/leds/leds-pca955x.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -495,10 +495,10 @@ static int pca955x_set_value(struct gpio_chip *gc, unsigned int offset,
495495
return pca955x_led_set(&led->led_cdev, PCA955X_GPIO_LOW);
496496
}
497497

498-
static void pca955x_gpio_set_value(struct gpio_chip *gc, unsigned int offset,
499-
int val)
498+
static int pca955x_gpio_set_value(struct gpio_chip *gc, unsigned int offset,
499+
int val)
500500
{
501-
pca955x_set_value(gc, offset, val);
501+
return pca955x_set_value(gc, offset, val);
502502
}
503503

504504
static int pca955x_gpio_get_value(struct gpio_chip *gc, unsigned int offset)
@@ -737,7 +737,7 @@ static int pca955x_probe(struct i2c_client *client)
737737
pca955x->gpio.label = "gpio-pca955x";
738738
pca955x->gpio.direction_input = pca955x_gpio_direction_input;
739739
pca955x->gpio.direction_output = pca955x_gpio_direction_output;
740-
pca955x->gpio.set = pca955x_gpio_set_value;
740+
pca955x->gpio.set_rv = pca955x_gpio_set_value;
741741
pca955x->gpio.get = pca955x_gpio_get_value;
742742
pca955x->gpio.request = pca955x_gpio_request_pin;
743743
pca955x->gpio.free = pca955x_gpio_free_pin;

0 commit comments

Comments
 (0)