Skip to content

Commit 54ac723

Browse files
Bartosz Golaszewskimaddy-kerneldev
authored andcommitted
powerpc: sysdev/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 03c9d1a commit 54ac723

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

arch/powerpc/sysdev/cpm_common.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static void __cpm2_gpio32_set(struct of_mm_gpio_chip *mm_gc, u32 pin_mask,
138138
out_be32(&iop->dat, cpm2_gc->cpdata);
139139
}
140140

141-
static void cpm2_gpio32_set(struct gpio_chip *gc, unsigned int gpio, int value)
141+
static int cpm2_gpio32_set(struct gpio_chip *gc, unsigned int gpio, int value)
142142
{
143143
struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);
144144
struct cpm2_gpio32_chip *cpm2_gc = gpiochip_get_data(gc);
@@ -150,6 +150,8 @@ static void cpm2_gpio32_set(struct gpio_chip *gc, unsigned int gpio, int value)
150150
__cpm2_gpio32_set(mm_gc, pin_mask, value);
151151

152152
spin_unlock_irqrestore(&cpm2_gc->lock, flags);
153+
154+
return 0;
153155
}
154156

155157
static int cpm2_gpio32_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
@@ -208,7 +210,7 @@ int cpm2_gpiochip_add32(struct device *dev)
208210
gc->direction_input = cpm2_gpio32_dir_in;
209211
gc->direction_output = cpm2_gpio32_dir_out;
210212
gc->get = cpm2_gpio32_get;
211-
gc->set = cpm2_gpio32_set;
213+
gc->set_rv = cpm2_gpio32_set;
212214
gc->parent = dev;
213215
gc->owner = THIS_MODULE;
214216

0 commit comments

Comments
 (0)