Skip to content

Commit c8fb184

Browse files
Bartosz Golaszewskimaddy-kerneldev
authored andcommitted
powerpc: 52xx/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 5effda1 commit c8fb184

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

arch/powerpc/platforms/52xx/mpc52xx_gpt.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ static int mpc52xx_gpt_gpio_get(struct gpio_chip *gc, unsigned int gpio)
280280
return (in_be32(&gpt->regs->status) >> 8) & 1;
281281
}
282282

283-
static void
283+
static int
284284
mpc52xx_gpt_gpio_set(struct gpio_chip *gc, unsigned int gpio, int v)
285285
{
286286
struct mpc52xx_gpt_priv *gpt = gpiochip_get_data(gc);
@@ -293,6 +293,8 @@ mpc52xx_gpt_gpio_set(struct gpio_chip *gc, unsigned int gpio, int v)
293293
raw_spin_lock_irqsave(&gpt->lock, flags);
294294
clrsetbits_be32(&gpt->regs->mode, MPC52xx_GPT_MODE_GPIO_MASK, r);
295295
raw_spin_unlock_irqrestore(&gpt->lock, flags);
296+
297+
return 0;
296298
}
297299

298300
static int mpc52xx_gpt_gpio_dir_in(struct gpio_chip *gc, unsigned int gpio)
@@ -334,7 +336,7 @@ static void mpc52xx_gpt_gpio_setup(struct mpc52xx_gpt_priv *gpt)
334336
gpt->gc.direction_input = mpc52xx_gpt_gpio_dir_in;
335337
gpt->gc.direction_output = mpc52xx_gpt_gpio_dir_out;
336338
gpt->gc.get = mpc52xx_gpt_gpio_get;
337-
gpt->gc.set = mpc52xx_gpt_gpio_set;
339+
gpt->gc.set_rv = mpc52xx_gpt_gpio_set;
338340
gpt->gc.base = -1;
339341
gpt->gc.parent = gpt->dev;
340342

0 commit comments

Comments
 (0)