]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
gpio: sch311x: use new GPIO line value setter callbacks
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 25 Jun 2025 10:33:25 +0000 (12:33 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 2 Jul 2025 09:05:37 +0000 (11:05 +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.

Link: https://lore.kernel.org/r/20250625-gpiochip-set-rv-gpio-round2-v1-2-bc110a3b52ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-sch311x.c

index ba4fccf3cc94f108f036936bc2d5006fb4d060a3..44fb5fc21fb8aaa7a4edde5605e3e23c79ab806e 100644 (file)
@@ -178,14 +178,16 @@ static void __sch311x_gpio_set(struct sch311x_gpio_block *block,
        outb(data, block->runtime_reg + block->data_reg);
 }
 
-static void sch311x_gpio_set(struct gpio_chip *chip, unsigned offset,
-                            int value)
+static int sch311x_gpio_set(struct gpio_chip *chip, unsigned int offset,
+                           int value)
 {
        struct sch311x_gpio_block *block = gpiochip_get_data(chip);
 
        spin_lock(&block->lock);
        __sch311x_gpio_set(block, offset, value);
        spin_unlock(&block->lock);
+
+       return 0;
 }
 
 static int sch311x_gpio_direction_in(struct gpio_chip *chip, unsigned offset)
@@ -295,7 +297,7 @@ static int sch311x_gpio_probe(struct platform_device *pdev)
                block->chip.get_direction = sch311x_gpio_get_direction;
                block->chip.set_config = sch311x_gpio_set_config;
                block->chip.get = sch311x_gpio_get;
-               block->chip.set = sch311x_gpio_set;
+               block->chip.set_rv = sch311x_gpio_set;
                block->chip.ngpio = 8;
                block->chip.parent = &pdev->dev;
                block->chip.base = sch311x_gpio_blocks[i].base;