Skip to content

Commit 588dfcd

Browse files
author
Bartosz Golaszewski
committed
gpio: cs5535: use new 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. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 96498b8 commit 588dfcd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/gpio/gpio-cs5535.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,14 @@ static int chip_gpio_get(struct gpio_chip *chip, unsigned offset)
232232
return cs5535_gpio_isset(offset, GPIO_READ_BACK);
233233
}
234234

235-
static void chip_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
235+
static int chip_gpio_set(struct gpio_chip *chip, unsigned int offset, int val)
236236
{
237237
if (val)
238238
cs5535_gpio_set(offset, GPIO_OUTPUT_VAL);
239239
else
240240
cs5535_gpio_clear(offset, GPIO_OUTPUT_VAL);
241+
242+
return 0;
241243
}
242244

243245
static int chip_direction_input(struct gpio_chip *c, unsigned offset)
@@ -294,7 +296,7 @@ static struct cs5535_gpio_chip cs5535_gpio_chip = {
294296
.request = chip_gpio_request,
295297

296298
.get = chip_gpio_get,
297-
.set = chip_gpio_set,
299+
.set_rv = chip_gpio_set,
298300

299301
.direction_input = chip_direction_input,
300302
.direction_output = chip_direction_output,

0 commit comments

Comments
 (0)