Skip to content

Commit b0dfc1b

Browse files
Bartosz GolaszewskiLinus Walleij
authored andcommitted
pinctrl: at91: 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-9-504f91120b99@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 8e86af6 commit b0dfc1b

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

drivers/pinctrl/pinctrl-at91.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,18 +1449,19 @@ static int at91_gpio_get(struct gpio_chip *chip, unsigned offset)
14491449
return (pdsr & mask) != 0;
14501450
}
14511451

1452-
static void at91_gpio_set(struct gpio_chip *chip, unsigned offset,
1453-
int val)
1452+
static int at91_gpio_set(struct gpio_chip *chip, unsigned int offset, int val)
14541453
{
14551454
struct at91_gpio_chip *at91_gpio = gpiochip_get_data(chip);
14561455
void __iomem *pio = at91_gpio->regbase;
14571456
unsigned mask = 1 << offset;
14581457

14591458
writel_relaxed(mask, pio + (val ? PIO_SODR : PIO_CODR));
1459+
1460+
return 0;
14601461
}
14611462

1462-
static void at91_gpio_set_multiple(struct gpio_chip *chip,
1463-
unsigned long *mask, unsigned long *bits)
1463+
static int at91_gpio_set_multiple(struct gpio_chip *chip,
1464+
unsigned long *mask, unsigned long *bits)
14641465
{
14651466
struct at91_gpio_chip *at91_gpio = gpiochip_get_data(chip);
14661467
void __iomem *pio = at91_gpio->regbase;
@@ -1472,6 +1473,8 @@ static void at91_gpio_set_multiple(struct gpio_chip *chip,
14721473

14731474
writel_relaxed(set_mask, pio + PIO_SODR);
14741475
writel_relaxed(clear_mask, pio + PIO_CODR);
1476+
1477+
return 0;
14751478
}
14761479

14771480
static int at91_gpio_direction_output(struct gpio_chip *chip, unsigned offset,
@@ -1798,8 +1801,8 @@ static const struct gpio_chip at91_gpio_template = {
17981801
.direction_input = at91_gpio_direction_input,
17991802
.get = at91_gpio_get,
18001803
.direction_output = at91_gpio_direction_output,
1801-
.set = at91_gpio_set,
1802-
.set_multiple = at91_gpio_set_multiple,
1804+
.set_rv = at91_gpio_set,
1805+
.set_multiple_rv = at91_gpio_set_multiple,
18031806
.dbg_show = at91_gpio_dbg_show,
18041807
.can_sleep = false,
18051808
.ngpio = MAX_NB_GPIO_PER_BANK,

0 commit comments

Comments
 (0)