]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
powerpc: 44x/gpio: use new line value setter callbacks
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Fri, 2 May 2025 08:59:49 +0000 (10:59 +0200)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Sun, 4 May 2025 03:34:37 +0000 (09:04 +0530)
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20250502-gpiochip-set-rv-powerpc-v2-3-488e43e325bf@linaro.org
arch/powerpc/platforms/44x/gpio.c

index e5f2319e5cbe27d472b0c7421f88ce18848ea21f..d540e261d85aa9e0abf2bfaa93564fa54b2bdea9 100644 (file)
@@ -75,8 +75,7 @@ __ppc4xx_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
                clrbits32(&regs->or, GPIO_MASK(gpio));
 }
 
-static void
-ppc4xx_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
+static int ppc4xx_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
 {
        struct ppc4xx_gpio_chip *chip = gpiochip_get_data(gc);
        unsigned long flags;
@@ -88,6 +87,8 @@ ppc4xx_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
        spin_unlock_irqrestore(&chip->lock, flags);
 
        pr_debug("%s: gpio: %d val: %d\n", __func__, gpio, val);
+
+       return 0;
 }
 
 static int ppc4xx_gpio_dir_in(struct gpio_chip *gc, unsigned int gpio)
@@ -179,7 +180,7 @@ static int __init ppc4xx_add_gpiochips(void)
                gc->direction_input = ppc4xx_gpio_dir_in;
                gc->direction_output = ppc4xx_gpio_dir_out;
                gc->get = ppc4xx_gpio_get;
-               gc->set = ppc4xx_gpio_set;
+               gc->set_rv = ppc4xx_gpio_set;
 
                ret = of_mm_gpiochip_add_data(np, mm_gc, ppc4xx_gc);
                if (ret)