Skip to content

Commit 936df52

Browse files
Bartosz Golaszewskibroonie
authored andcommitted
regulator: rpi-panel-attiny: use new GPIO line value setter callbacks
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 50faedd commit 936df52

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/regulator/rpi-panel-attiny-regulator.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ static int attiny_gpio_get_direction(struct gpio_chip *gc, unsigned int off)
205205
return GPIO_LINE_DIRECTION_OUT;
206206
}
207207

208-
static void attiny_gpio_set(struct gpio_chip *gc, unsigned int off, int val)
208+
static int attiny_gpio_set(struct gpio_chip *gc, unsigned int off, int val)
209209
{
210210
struct attiny_lcd *state = gpiochip_get_data(gc);
211211
u8 last_val;
@@ -232,6 +232,8 @@ static void attiny_gpio_set(struct gpio_chip *gc, unsigned int off, int val)
232232

233233
msleep(100);
234234
}
235+
236+
return 0;
235237
}
236238

237239
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)
349351
state->gc.base = -1;
350352
state->gc.ngpio = NUM_GPIO;
351353

352-
state->gc.set = attiny_gpio_set;
354+
state->gc.set_rv = attiny_gpio_set;
353355
state->gc.get_direction = attiny_gpio_get_direction;
354356
state->gc.can_sleep = true;
355357

0 commit comments

Comments
 (0)