Skip to content

Commit 8152769

Browse files
Bartosz GolaszewskiLinus Walleij
authored andcommitted
pinctrl: armada-37xx: 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 <bartosz.golaszewski@linaro.org> Link: https://lore.kernel.org/20250424-gpiochip-set-rv-pinctrl-part2-v1-10-504f91120b99@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent b0dfc1b commit 8152769

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

drivers/pinctrl/mvebu/pinctrl-armada-37xx.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -424,15 +424,12 @@ static int armada_37xx_gpio_direction_output(struct gpio_chip *chip,
424424
mask = BIT(offset);
425425

426426
ret = regmap_update_bits(info->regmap, reg, mask, mask);
427-
428427
if (ret)
429428
return ret;
430429

431430
reg = OUTPUT_VAL;
432431
val = value ? mask : 0;
433-
regmap_update_bits(info->regmap, reg, mask, val);
434-
435-
return 0;
432+
return regmap_update_bits(info->regmap, reg, mask, val);
436433
}
437434

438435
static int armada_37xx_gpio_get(struct gpio_chip *chip, unsigned int offset)
@@ -449,8 +446,8 @@ static int armada_37xx_gpio_get(struct gpio_chip *chip, unsigned int offset)
449446
return (val & mask) != 0;
450447
}
451448

452-
static void armada_37xx_gpio_set(struct gpio_chip *chip, unsigned int offset,
453-
int value)
449+
static int armada_37xx_gpio_set(struct gpio_chip *chip, unsigned int offset,
450+
int value)
454451
{
455452
struct armada_37xx_pinctrl *info = gpiochip_get_data(chip);
456453
unsigned int reg = OUTPUT_VAL;
@@ -460,7 +457,7 @@ static void armada_37xx_gpio_set(struct gpio_chip *chip, unsigned int offset,
460457
mask = BIT(offset);
461458
val = value ? mask : 0;
462459

463-
regmap_update_bits(info->regmap, reg, mask, val);
460+
return regmap_update_bits(info->regmap, reg, mask, val);
464461
}
465462

466463
static int armada_37xx_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
@@ -513,7 +510,7 @@ static const struct pinmux_ops armada_37xx_pmx_ops = {
513510
static const struct gpio_chip armada_37xx_gpiolib_chip = {
514511
.request = gpiochip_generic_request,
515512
.free = gpiochip_generic_free,
516-
.set = armada_37xx_gpio_set,
513+
.set_rv = armada_37xx_gpio_set,
517514
.get = armada_37xx_gpio_get,
518515
.get_direction = armada_37xx_gpio_get_direction,
519516
.direction_input = armada_37xx_gpio_direction_input,

0 commit comments

Comments
 (0)