Skip to content

Commit ec08e2c

Browse files
Bartosz GolaszewskiLinus Walleij
authored andcommitted
pinctrl: amd: 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-1-504f91120b99@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 278114c commit ec08e2c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/pinctrl/pinctrl-amd.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ static int amd_gpio_get_value(struct gpio_chip *gc, unsigned offset)
101101
return !!(pin_reg & BIT(PIN_STS_OFF));
102102
}
103103

104-
static void amd_gpio_set_value(struct gpio_chip *gc, unsigned offset, int value)
104+
static int amd_gpio_set_value(struct gpio_chip *gc, unsigned int offset,
105+
int value)
105106
{
106107
u32 pin_reg;
107108
unsigned long flags;
@@ -115,6 +116,8 @@ static void amd_gpio_set_value(struct gpio_chip *gc, unsigned offset, int value)
115116
pin_reg &= ~BIT(OUTPUT_VALUE_OFF);
116117
writel(pin_reg, gpio_dev->base + offset * 4);
117118
raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
119+
120+
return 0;
118121
}
119122

120123
static int amd_gpio_set_debounce(struct amd_gpio *gpio_dev, unsigned int offset,
@@ -1128,7 +1131,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
11281131
gpio_dev->gc.direction_input = amd_gpio_direction_input;
11291132
gpio_dev->gc.direction_output = amd_gpio_direction_output;
11301133
gpio_dev->gc.get = amd_gpio_get_value;
1131-
gpio_dev->gc.set = amd_gpio_set_value;
1134+
gpio_dev->gc.set_rv = amd_gpio_set_value;
11321135
gpio_dev->gc.set_config = amd_gpio_set_config;
11331136
gpio_dev->gc.dbg_show = amd_gpio_dbg_show;
11341137

0 commit comments

Comments
 (0)