]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
pinctrl: xway: use new GPIO line value setter callbacks
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 12 Jun 2025 13:15:17 +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-8-556b0a530cd4@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-xway.c

index 02e65d25e72911b812446ad4b90bfd611c9c1714..53c6c22ff24d752ba66bdd8d46c860bfd9a93731 100644 (file)
@@ -1293,7 +1293,7 @@ static struct ltq_pinmux_info xway_info = {
 };
 
 /* ---------  gpio_chip related code --------- */
-static void xway_gpio_set(struct gpio_chip *chip, unsigned int pin, int val)
+static int xway_gpio_set(struct gpio_chip *chip, unsigned int pin, int val)
 {
        struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent);
 
@@ -1301,6 +1301,8 @@ static void xway_gpio_set(struct gpio_chip *chip, unsigned int pin, int val)
                gpio_setbit(info->membase[0], GPIO_OUT(pin), PORT_PIN(pin));
        else
                gpio_clearbit(info->membase[0], GPIO_OUT(pin), PORT_PIN(pin));
+
+       return 0;
 }
 
 static int xway_gpio_get(struct gpio_chip *chip, unsigned int pin)
@@ -1328,9 +1330,7 @@ static int xway_gpio_dir_out(struct gpio_chip *chip, unsigned int pin, int val)
        else
                gpio_setbit(info->membase[0], GPIO_OD(pin), PORT_PIN(pin));
        gpio_setbit(info->membase[0], GPIO_DIR(pin), PORT_PIN(pin));
-       xway_gpio_set(chip, pin, val);
-
-       return 0;
+       return xway_gpio_set(chip, pin, val);
 }
 
 /*
@@ -1354,7 +1354,7 @@ static struct gpio_chip xway_chip = {
        .direction_input = xway_gpio_dir_in,
        .direction_output = xway_gpio_dir_out,
        .get = xway_gpio_get,
-       .set = xway_gpio_set,
+       .set_rv = xway_gpio_set,
        .request = gpiochip_generic_request,
        .free = gpiochip_generic_free,
        .to_irq = xway_gpio_to_irq,