]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpio: mpc5200: use new GPIO line value setter callbacks
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 10 Jun 2025 12:33:14 +0000 (14:33 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 17 Jun 2025 09:09:30 +0000 (11:09 +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/20250610-gpiochip-set-rv-gpio-v1-4-3a9a3c1472ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-mpc5200.c

index 091d96f2d682941378d251e95eed88ff16bd39c2..40d587176a754a6277b87b760f562ed5304b6eef 100644 (file)
@@ -69,7 +69,7 @@ __mpc52xx_wkup_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
        out_8(&regs->wkup_dvo, chip->shadow_dvo);
 }
 
-static void
+static int
 mpc52xx_wkup_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
 {
        unsigned long flags;
@@ -81,6 +81,8 @@ mpc52xx_wkup_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
        spin_unlock_irqrestore(&gpio_lock, flags);
 
        pr_debug("%s: gpio: %d val: %d\n", __func__, gpio, val);
+
+       return 0;
 }
 
 static int mpc52xx_wkup_gpio_dir_in(struct gpio_chip *gc, unsigned int gpio)
@@ -151,7 +153,7 @@ static int mpc52xx_wkup_gpiochip_probe(struct platform_device *ofdev)
        gc->direction_input  = mpc52xx_wkup_gpio_dir_in;
        gc->direction_output = mpc52xx_wkup_gpio_dir_out;
        gc->get              = mpc52xx_wkup_gpio_get;
-       gc->set              = mpc52xx_wkup_gpio_set;
+       gc->set_rv           = mpc52xx_wkup_gpio_set;
 
        ret = of_mm_gpiochip_add_data(ofdev->dev.of_node, &chip->mmchip, chip);
        if (ret)
@@ -228,7 +230,7 @@ __mpc52xx_simple_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
        out_be32(&regs->simple_dvo, chip->shadow_dvo);
 }
 
-static void
+static int
 mpc52xx_simple_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
 {
        unsigned long flags;
@@ -240,6 +242,8 @@ mpc52xx_simple_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
        spin_unlock_irqrestore(&gpio_lock, flags);
 
        pr_debug("%s: gpio: %d val: %d\n", __func__, gpio, val);
+
+       return 0;
 }
 
 static int mpc52xx_simple_gpio_dir_in(struct gpio_chip *gc, unsigned int gpio)
@@ -311,7 +315,7 @@ static int mpc52xx_simple_gpiochip_probe(struct platform_device *ofdev)
        gc->direction_input  = mpc52xx_simple_gpio_dir_in;
        gc->direction_output = mpc52xx_simple_gpio_dir_out;
        gc->get              = mpc52xx_simple_gpio_get;
-       gc->set              = mpc52xx_simple_gpio_set;
+       gc->set_rv           = mpc52xx_simple_gpio_set;
 
        ret = of_mm_gpiochip_add_data(ofdev->dev.of_node, &chip->mmchip, chip);
        if (ret)