]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpio: amd8111: use new line value setter callbacks
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 3 Mar 2025 13:18:34 +0000 (14:18 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 10 Mar 2025 10:52:13 +0000 (11:52 +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.

Link: https://lore.kernel.org/r/20250303-gpiochip-set-conversion-v1-9-1d5cceeebf8b@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-amd8111.c

index 3377667a28de7c2794b0892502d2181300d4f1cc..425d8472f744378e59cba69ca0906db121e45fa5 100644 (file)
@@ -94,7 +94,7 @@ static void amd_gpio_free(struct gpio_chip *chip, unsigned offset)
        iowrite8(agp->orig[offset], agp->pm + AMD_REG_GPIO(offset));
 }
 
-static void amd_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+static int amd_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
 {
        struct amd_gpio *agp = gpiochip_get_data(chip);
        u8 temp;
@@ -107,6 +107,8 @@ static void amd_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
        spin_unlock_irqrestore(&agp->lock, flags);
 
        dev_dbg(&agp->pdev->dev, "Setting gpio %d, value %d, reg=%02x\n", offset, !!value, temp);
+
+       return 0;
 }
 
 static int amd_gpio_get(struct gpio_chip *chip, unsigned offset)
@@ -163,7 +165,7 @@ static struct amd_gpio gp = {
                .ngpio          = 32,
                .request        = amd_gpio_request,
                .free           = amd_gpio_free,
-               .set            = amd_gpio_set,
+               .set_rv         = amd_gpio_set,
                .get            = amd_gpio_get,
                .direction_output = amd_gpio_dirout,
                .direction_input = amd_gpio_dirin,