Skip to content

Commit adf5412

Browse files
author
Bartosz Golaszewski
committed
gpio: altera: 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/20250303-gpiochip-set-conversion-v1-8-1d5cceeebf8b@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent 65a0b13 commit adf5412

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/gpio/gpio-altera.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static int altera_gpio_get(struct gpio_chip *gc, unsigned offset)
113113
return !!(readl(altera_gc->regs + ALTERA_GPIO_DATA) & BIT(offset));
114114
}
115115

116-
static void altera_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
116+
static int altera_gpio_set(struct gpio_chip *gc, unsigned int offset, int value)
117117
{
118118
struct altera_gpio_chip *altera_gc = gpiochip_get_data(gc);
119119
unsigned long flags;
@@ -127,6 +127,8 @@ static void altera_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
127127
data_reg &= ~BIT(offset);
128128
writel(data_reg, altera_gc->regs + ALTERA_GPIO_DATA);
129129
raw_spin_unlock_irqrestore(&altera_gc->gpio_lock, flags);
130+
131+
return 0;
130132
}
131133

132134
static int altera_gpio_direction_input(struct gpio_chip *gc, unsigned offset)
@@ -257,7 +259,7 @@ static int altera_gpio_probe(struct platform_device *pdev)
257259
altera_gc->gc.direction_input = altera_gpio_direction_input;
258260
altera_gc->gc.direction_output = altera_gpio_direction_output;
259261
altera_gc->gc.get = altera_gpio_get;
260-
altera_gc->gc.set = altera_gpio_set;
262+
altera_gc->gc.set_rv = altera_gpio_set;
261263
altera_gc->gc.owner = THIS_MODULE;
262264
altera_gc->gc.parent = &pdev->dev;
263265
altera_gc->gc.base = -1;

0 commit comments

Comments
 (0)