Skip to content

Commit fe7667f

Browse files
author
Bartosz Golaszewski
committed
gpio: bd9571mwv: 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. Reviewed-by: Matti Vaittinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 8a050f7 commit fe7667f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/gpio/gpio-bd9571mwv.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ static int bd9571mwv_gpio_get(struct gpio_chip *chip, unsigned int offset)
7272
return val & BIT(offset);
7373
}
7474

75-
static void bd9571mwv_gpio_set(struct gpio_chip *chip, unsigned int offset,
75+
static int bd9571mwv_gpio_set(struct gpio_chip *chip, unsigned int offset,
7676
int value)
7777
{
7878
struct bd9571mwv_gpio *gpio = gpiochip_get_data(chip);
7979

80-
regmap_update_bits(gpio->regmap, BD9571MWV_GPIO_OUT,
81-
BIT(offset), value ? BIT(offset) : 0);
80+
return regmap_update_bits(gpio->regmap, BD9571MWV_GPIO_OUT,
81+
BIT(offset), value ? BIT(offset) : 0);
8282
}
8383

8484
static const struct gpio_chip template_chip = {
@@ -88,7 +88,7 @@ static const struct gpio_chip template_chip = {
8888
.direction_input = bd9571mwv_gpio_direction_input,
8989
.direction_output = bd9571mwv_gpio_direction_output,
9090
.get = bd9571mwv_gpio_get,
91-
.set = bd9571mwv_gpio_set,
91+
.set_rv = bd9571mwv_gpio_set,
9292
.base = -1,
9393
.ngpio = 2,
9494
.can_sleep = true,

0 commit comments

Comments
 (0)