Skip to content

Commit ee08ec5

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

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/leds/blink/leds-lgm-sso.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,14 +450,16 @@ static int sso_gpio_get(struct gpio_chip *chip, unsigned int offset)
450450
return !!(reg_val & BIT(offset));
451451
}
452452

453-
static void sso_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
453+
static int sso_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
454454
{
455455
struct sso_led_priv *priv = gpiochip_get_data(chip);
456456

457457
regmap_update_bits(priv->mmap, SSO_CPU, BIT(offset), value << offset);
458458
if (!priv->gpio.freq)
459459
regmap_update_bits(priv->mmap, SSO_CON0, SSO_CON0_SWU,
460460
SSO_CON0_SWU);
461+
462+
return 0;
461463
}
462464

463465
static int sso_gpio_gc_init(struct device *dev, struct sso_led_priv *priv)
@@ -469,7 +471,7 @@ static int sso_gpio_gc_init(struct device *dev, struct sso_led_priv *priv)
469471
gc->get_direction = sso_gpio_get_dir;
470472
gc->direction_output = sso_gpio_dir_out;
471473
gc->get = sso_gpio_get;
472-
gc->set = sso_gpio_set;
474+
gc->set_rv = sso_gpio_set;
473475

474476
gc->label = "lgm-sso";
475477
gc->base = -1;

0 commit comments

Comments
 (0)