]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
pinctrl: amd: use new GPIO line value setter callbacks
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 24 Apr 2025 08:35:24 +0000 (10:35 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 29 Apr 2025 08:30:59 +0000 (10:30 +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/20250424-gpiochip-set-rv-pinctrl-part2-v1-1-504f91120b99@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-amd.c

index 1d7fdcdec4c8551d5f9bf4ed9e59d389ef7a08e4..9ab3a7fc3bdd127fd9ce8c013851cd03fac22b97 100644 (file)
@@ -101,7 +101,8 @@ static int amd_gpio_get_value(struct gpio_chip *gc, unsigned offset)
        return !!(pin_reg & BIT(PIN_STS_OFF));
 }
 
-static void amd_gpio_set_value(struct gpio_chip *gc, unsigned offset, int value)
+static int amd_gpio_set_value(struct gpio_chip *gc, unsigned int offset,
+                             int value)
 {
        u32 pin_reg;
        unsigned long flags;
@@ -115,6 +116,8 @@ static void amd_gpio_set_value(struct gpio_chip *gc, unsigned offset, int value)
                pin_reg &= ~BIT(OUTPUT_VALUE_OFF);
        writel(pin_reg, gpio_dev->base + offset * 4);
        raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
+
+       return 0;
 }
 
 static int amd_gpio_set_debounce(struct amd_gpio *gpio_dev, unsigned int offset,
@@ -1128,7 +1131,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
        gpio_dev->gc.direction_input    = amd_gpio_direction_input;
        gpio_dev->gc.direction_output   = amd_gpio_direction_output;
        gpio_dev->gc.get                        = amd_gpio_get_value;
-       gpio_dev->gc.set                        = amd_gpio_set_value;
+       gpio_dev->gc.set_rv                     = amd_gpio_set_value;
        gpio_dev->gc.set_config         = amd_gpio_set_config;
        gpio_dev->gc.dbg_show           = amd_gpio_dbg_show;