]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
leds: lgm-sso: Use new GPIO line value setter callbacks
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 23 Apr 2025 07:53:50 +0000 (09:53 +0200)
committerLee Jones <lee@kernel.org>
Wed, 14 May 2025 08:24:58 +0000 (09:24 +0100)
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>
drivers/leds/blink/leds-lgm-sso.c

index effaaaf302b588856fea7c91e718f77109c89550..c9027f9c4bb79dfcfe16cfbcd24d1e30d8daabf0 100644 (file)
@@ -450,7 +450,7 @@ static int sso_gpio_get(struct gpio_chip *chip, unsigned int offset)
        return !!(reg_val & BIT(offset));
 }
 
-static void sso_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
+static int sso_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
 {
        struct sso_led_priv *priv = gpiochip_get_data(chip);
 
@@ -458,6 +458,8 @@ static void sso_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
        if (!priv->gpio.freq)
                regmap_update_bits(priv->mmap, SSO_CON0, SSO_CON0_SWU,
                                   SSO_CON0_SWU);
+
+       return 0;
 }
 
 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)
        gc->get_direction       = sso_gpio_get_dir;
        gc->direction_output    = sso_gpio_dir_out;
        gc->get                 = sso_gpio_get;
-       gc->set                 = sso_gpio_set;
+       gc->set_rv              = sso_gpio_set;
 
        gc->label               = "lgm-sso";
        gc->base                = -1;