Skip to content

Commit 68f5b74

Browse files
author
Bartosz Golaszewski
committed
gpio: creg-snps: 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/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 1e69c75 commit 68f5b74

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/gpio/gpio-creg-snps.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct creg_gpio {
2727
const struct creg_layout *layout;
2828
};
2929

30-
static void creg_gpio_set(struct gpio_chip *gc, unsigned int offset, int val)
30+
static int creg_gpio_set(struct gpio_chip *gc, unsigned int offset, int val)
3131
{
3232
struct creg_gpio *hcg = gpiochip_get_data(gc);
3333
const struct creg_layout *layout = hcg->layout;
@@ -47,13 +47,13 @@ static void creg_gpio_set(struct gpio_chip *gc, unsigned int offset, int val)
4747
reg |= (value << reg_shift);
4848
writel(reg, hcg->regs);
4949
spin_unlock_irqrestore(&hcg->lock, flags);
50+
51+
return 0;
5052
}
5153

5254
static int creg_gpio_dir_out(struct gpio_chip *gc, unsigned int offset, int val)
5355
{
54-
creg_gpio_set(gc, offset, val);
55-
56-
return 0;
56+
return creg_gpio_set(gc, offset, val);
5757
}
5858

5959
static int creg_gpio_validate_pg(struct device *dev, struct creg_gpio *hcg,
@@ -167,7 +167,7 @@ static int creg_gpio_probe(struct platform_device *pdev)
167167
hcg->gc.label = dev_name(dev);
168168
hcg->gc.base = -1;
169169
hcg->gc.ngpio = ngpios;
170-
hcg->gc.set = creg_gpio_set;
170+
hcg->gc.set_rv = creg_gpio_set;
171171
hcg->gc.direction_output = creg_gpio_dir_out;
172172

173173
ret = devm_gpiochip_add_data(dev, &hcg->gc, hcg);

0 commit comments

Comments
 (0)