]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
pinctrl: da9062: use new GPIO line value setter callbacks
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 12 Jun 2025 13:15:12 +0000 (15:15 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 18 Jun 2025 12:08:37 +0000 (14:08 +0200)
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>
Link: https://lore.kernel.org/20250612-gpiochip-set-rv-pinctrl-remaining-v1-3-556b0a530cd4@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-da9062.c

index 6f44a13b90ce56dbb00fdbedc28b0377a42d3b0c..3295b09dfc3daf8feb6de0082d95952e1cf25d26 100644 (file)
@@ -102,14 +102,14 @@ static int da9062_gpio_get(struct gpio_chip *gc, unsigned int offset)
        return !!(val & BIT(offset));
 }
 
-static void da9062_gpio_set(struct gpio_chip *gc, unsigned int offset,
-                           int value)
+static int da9062_gpio_set(struct gpio_chip *gc, unsigned int offset,
+                          int value)
 {
        struct da9062_pctl *pctl = gpiochip_get_data(gc);
        struct regmap *regmap = pctl->da9062->regmap;
 
-       regmap_update_bits(regmap, DA9062AA_GPIO_MODE0_4, BIT(offset),
-                          value << offset);
+       return regmap_update_bits(regmap, DA9062AA_GPIO_MODE0_4, BIT(offset),
+                                 value << offset);
 }
 
 static int da9062_gpio_get_direction(struct gpio_chip *gc, unsigned int offset)
@@ -172,9 +172,7 @@ static int da9062_gpio_direction_output(struct gpio_chip *gc,
        if (ret)
                return ret;
 
-       da9062_gpio_set(gc, offset, value);
-
-       return 0;
+       return da9062_gpio_set(gc, offset, value);
 }
 
 static int da9062_gpio_set_config(struct gpio_chip *gc, unsigned int offset,
@@ -235,7 +233,7 @@ static int da9062_gpio_to_irq(struct gpio_chip *gc, unsigned int offset)
 static const struct gpio_chip reference_gc = {
        .owner = THIS_MODULE,
        .get = da9062_gpio_get,
-       .set = da9062_gpio_set,
+       .set_rv = da9062_gpio_set,
        .get_direction = da9062_gpio_get_direction,
        .direction_input = da9062_gpio_direction_input,
        .direction_output = da9062_gpio_direction_output,