Skip to content

Commit dff5a31

Browse files
author
Bartosz Golaszewski
committed
gpio: mb86s7x: 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. Link: https://lore.kernel.org/r/20250506-gpiochip-set-rv-gpio-part3-v1-10-0fbdea5a9667@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent 8f9da44 commit dff5a31

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/gpio/gpio-mb86s7x.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static int mb86s70_gpio_get(struct gpio_chip *gc, unsigned gpio)
119119
return !!(readl(gchip->base + PDR(gpio)) & OFFSET(gpio));
120120
}
121121

122-
static void mb86s70_gpio_set(struct gpio_chip *gc, unsigned gpio, int value)
122+
static int mb86s70_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value)
123123
{
124124
struct mb86s70_gpio_chip *gchip = gpiochip_get_data(gc);
125125
unsigned long flags;
@@ -135,6 +135,8 @@ static void mb86s70_gpio_set(struct gpio_chip *gc, unsigned gpio, int value)
135135
writel(val, gchip->base + PDR(gpio));
136136

137137
spin_unlock_irqrestore(&gchip->lock, flags);
138+
139+
return 0;
138140
}
139141

140142
static int mb86s70_gpio_to_irq(struct gpio_chip *gc, unsigned int offset)
@@ -178,7 +180,7 @@ static int mb86s70_gpio_probe(struct platform_device *pdev)
178180
gchip->gc.request = mb86s70_gpio_request;
179181
gchip->gc.free = mb86s70_gpio_free;
180182
gchip->gc.get = mb86s70_gpio_get;
181-
gchip->gc.set = mb86s70_gpio_set;
183+
gchip->gc.set_rv = mb86s70_gpio_set;
182184
gchip->gc.to_irq = mb86s70_gpio_to_irq;
183185
gchip->gc.label = dev_name(&pdev->dev);
184186
gchip->gc.ngpio = 32;

0 commit comments

Comments
 (0)