regulator: rpi-panel-attiny: use new GPIO line value setter callbacks
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 8 Apr 2025 07:36:31 +0000 (09:36 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 8 Apr 2025 11:05:42 +0000 (12:05 +0100)
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://patch.msgid.link/20250408-gpiochip-set-rv-regulator-v1-4-a18b6154b31a@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/rpi-panel-attiny-regulator.c

index 43a7c4737cb43d3905c1a26592a8fd0741785202..58dbf8bffa5dd25bc5ffb86006c1924a1a5df9bf 100644 (file)
@@ -205,7 +205,7 @@ static int attiny_gpio_get_direction(struct gpio_chip *gc, unsigned int off)
        return GPIO_LINE_DIRECTION_OUT;
 }
 
-static void attiny_gpio_set(struct gpio_chip *gc, unsigned int off, int val)
+static int attiny_gpio_set(struct gpio_chip *gc, unsigned int off, int val)
 {
        struct attiny_lcd *state = gpiochip_get_data(gc);
        u8 last_val;
@@ -232,6 +232,8 @@ static void attiny_gpio_set(struct gpio_chip *gc, unsigned int off, int val)
 
                msleep(100);
        }
+
+       return 0;
 }
 
 static int attiny_i2c_read(struct i2c_client *client, u8 reg, unsigned int *buf)
@@ -349,7 +351,7 @@ static int attiny_i2c_probe(struct i2c_client *i2c)
        state->gc.base = -1;
        state->gc.ngpio = NUM_GPIO;
 
-       state->gc.set = attiny_gpio_set;
+       state->gc.set_rv = attiny_gpio_set;
        state->gc.get_direction = attiny_gpio_get_direction;
        state->gc.can_sleep = true;