Skip to content

Commit 5effda1

Browse files
Bartosz Golaszewskimaddy-kerneldev
authored andcommitted
powerpc: 44x/gpio: 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. Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Christophe Leroy <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Madhavan Srinivasan <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 077f873 commit 5effda1

File tree

1 file changed

+4
-3
lines changed
  • arch/powerpc/platforms/44x

1 file changed

+4
-3
lines changed

arch/powerpc/platforms/44x/gpio.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ __ppc4xx_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
7575
clrbits32(&regs->or, GPIO_MASK(gpio));
7676
}
7777

78-
static void
79-
ppc4xx_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
78+
static int ppc4xx_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
8079
{
8180
struct ppc4xx_gpio_chip *chip = gpiochip_get_data(gc);
8281
unsigned long flags;
@@ -88,6 +87,8 @@ ppc4xx_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
8887
spin_unlock_irqrestore(&chip->lock, flags);
8988

9089
pr_debug("%s: gpio: %d val: %d\n", __func__, gpio, val);
90+
91+
return 0;
9192
}
9293

9394
static int ppc4xx_gpio_dir_in(struct gpio_chip *gc, unsigned int gpio)
@@ -179,7 +180,7 @@ static int __init ppc4xx_add_gpiochips(void)
179180
gc->direction_input = ppc4xx_gpio_dir_in;
180181
gc->direction_output = ppc4xx_gpio_dir_out;
181182
gc->get = ppc4xx_gpio_get;
182-
gc->set = ppc4xx_gpio_set;
183+
gc->set_rv = ppc4xx_gpio_set;
183184

184185
ret = of_mm_gpiochip_add_data(np, mm_gc, ppc4xx_gc);
185186
if (ret)

0 commit comments

Comments
 (0)