]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpio: rcar: Use new line value setter callbacks
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 25 Jun 2025 08:05:47 +0000 (10:05 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 26 Jun 2025 08:52:04 +0000 (10:52 +0200)
struct gpio_chip now has callbacks for setting line values that return
integers, so they can indicate failures.  Convert the driver to using
them.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/f09a0481fc0ddafb9aa05d903fbb42ef52332c03.1750838486.git.geert+renesas@glider.be
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-rcar.c

index 8416e0430887bd5e55ab7d4e924542d9cafcc0d1..1d121a4275905e09912286d1cdf63bc98d0a5b2f 100644 (file)
@@ -356,7 +356,7 @@ static int gpio_rcar_get_multiple(struct gpio_chip *chip, unsigned long *mask,
        return 0;
 }
 
-static void gpio_rcar_set(struct gpio_chip *chip, unsigned offset, int value)
+static int gpio_rcar_set(struct gpio_chip *chip, unsigned int offset, int value)
 {
        struct gpio_rcar_priv *p = gpiochip_get_data(chip);
        unsigned long flags;
@@ -364,10 +364,12 @@ static void gpio_rcar_set(struct gpio_chip *chip, unsigned offset, int value)
        raw_spin_lock_irqsave(&p->lock, flags);
        gpio_rcar_modify_bit(p, OUTDT, offset, value);
        raw_spin_unlock_irqrestore(&p->lock, flags);
+
+       return 0;
 }
 
-static void gpio_rcar_set_multiple(struct gpio_chip *chip, unsigned long *mask,
-                                  unsigned long *bits)
+static int gpio_rcar_set_multiple(struct gpio_chip *chip, unsigned long *mask,
+                                 unsigned long *bits)
 {
        u32 bankmask = mask[0] & GENMASK(chip->ngpio - 1, 0);
        struct gpio_rcar_priv *p = gpiochip_get_data(chip);
@@ -380,6 +382,8 @@ static void gpio_rcar_set_multiple(struct gpio_chip *chip, unsigned long *mask,
        val |= (bankmask & bits[0]);
        gpio_rcar_write(p, OUTDT, val);
        raw_spin_unlock_irqrestore(&p->lock, flags);
+
+       return 0;
 }
 
 static int gpio_rcar_direction_output(struct gpio_chip *chip, unsigned offset,
@@ -531,8 +535,8 @@ static int gpio_rcar_probe(struct platform_device *pdev)
        gpio_chip->get = gpio_rcar_get;
        gpio_chip->get_multiple = gpio_rcar_get_multiple;
        gpio_chip->direction_output = gpio_rcar_direction_output;
-       gpio_chip->set = gpio_rcar_set;
-       gpio_chip->set_multiple = gpio_rcar_set_multiple;
+       gpio_chip->set_rv = gpio_rcar_set;
+       gpio_chip->set_multiple_rv = gpio_rcar_set_multiple;
        gpio_chip->label = name;
        gpio_chip->parent = dev;
        gpio_chip->owner = THIS_MODULE;