]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
pinctrl: bcm2835: use new GPIO line value setter callbacks
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Fri, 25 Apr 2025 09:08:31 +0000 (11:08 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 9 May 2025 08:05:52 +0000 (10: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.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250425-gpiochip-set-rv-pinctrl-bcm-v1-3-6b8883d79b66@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/bcm/pinctrl-bcm2835.c

index eaeec096bc9a96ef0cdd10088d08f7f0d2d2c7b3..8268278004744e259d5be79285347e982d903c09 100644 (file)
@@ -356,11 +356,14 @@ static int bcm2835_gpio_get_direction(struct gpio_chip *chip, unsigned int offse
        return GPIO_LINE_DIRECTION_IN;
 }
 
-static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+static int bcm2835_gpio_set(struct gpio_chip *chip, unsigned int offset,
+                           int value)
 {
        struct bcm2835_pinctrl *pc = gpiochip_get_data(chip);
 
        bcm2835_gpio_set_bit(pc, value ? GPSET0 : GPCLR0, offset);
+
+       return 0;
 }
 
 static int bcm2835_gpio_direction_output(struct gpio_chip *chip,
@@ -394,7 +397,7 @@ static const struct gpio_chip bcm2835_gpio_chip = {
        .direction_output = bcm2835_gpio_direction_output,
        .get_direction = bcm2835_gpio_get_direction,
        .get = bcm2835_gpio_get,
-       .set = bcm2835_gpio_set,
+       .set_rv = bcm2835_gpio_set,
        .set_config = gpiochip_generic_config,
        .base = -1,
        .ngpio = BCM2835_NUM_GPIOS,
@@ -411,7 +414,7 @@ static const struct gpio_chip bcm2711_gpio_chip = {
        .direction_output = bcm2835_gpio_direction_output,
        .get_direction = bcm2835_gpio_get_direction,
        .get = bcm2835_gpio_get,
-       .set = bcm2835_gpio_set,
+       .set_rv = bcm2835_gpio_set,
        .set_config = gpiochip_generic_config,
        .base = -1,
        .ngpio = BCM2711_NUM_GPIOS,